match '/' => "home#index", :as => :home
(
this assumes your rails app has been created with
rails generate controller home index
)
you can then create a link using linked_to
<%= link_to "Home", home_path %>
The point here is we've created the named link as "home" but the path is referred to home_path.
interesting blog. It would be great if you can provide more details about it. Thanks you
ReplyDeleteWeb Development
Thanks for this coding post. I will try it and have already
ReplyDeletebookmarked your blog
custom Web Design
Thanks for this simple solution on creating a link back to the home page - i was stuck for 30 mins and no other post gave a solution that worked for me.
ReplyDeleteThis is nice and informative post, Thanks to post.
ReplyDeleteROR Development | Ruby on Rails Development