On Aug 6, 2011, at 1:22 PM, Pepe Sanchez wrote:
Walter,
So if I understand correctly new_ticket_path, edit_ticket_path, ticket
are like constants that RoR assigns to them specific values.
If I want to create a new link on my RoR Application to a new page
called for example "myblog", and add it to the index page, which
will be
the right syntax?
link_to "myblog", ??????
That depends on where the blog is coming from. If it is part of your
Rails application, and you are linking to it from a different part of
the same Rails application, then you might be able to do something like:
link_to "My Blog", posts_path
Which would generate a link like this: <a href="http://localhost:3000/posts
">My Blog</a>
That's assuming that your blog is rendered by the #index method of the
PostsController. Substitute your own controller name as needed.
If you have two separate Rails applications, and you want to link from
one to the other, then you can either use a hand-written link, or you
can use the :url attribute in the link_to method. Read up on the
link_to generator in the API docs: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
Walter
Thanks
jose
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-
t...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.