On Mon, Feb 22, 2010 at 3:19 PM, Heinz Strunk <li...@ruby-forum.com> wrote:
> I tried
>  map.connect '/actions/:action_id/add_date/:date', :controller =>
> 'actions', action => 'add_date'
> instead of
>   map.connect ':controller/:id/:action/:action_id'
> but that didn't work cause that's not what's not working.
>
> I need to know how the link_to has to look like so the link_to URL looks
> like:
>   http://localhost:3000/actions/980190963/add_date/2010-02-23


Use a named route

   map.add_date_to_action  '/actions/:action_id/add_date/:date',
:controller =>  'actions', action => 'add_date'

And then:

   link_to "Add", add_date_to_action_url(@action.id, Date.today.to_s)

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

-- 
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.

Reply via email to