Ruby on Rails Tuesday, October 6, 2015

hi,

im getting started with STI but having trouble with link_to

1)
Model Animal
including an type column

2) routes:
#resource :animal
 resources :tiger , :controller => 'animals', type: 'tigler'
 resources :lion , :controller => 'animals', type: 'lion'

3) index.html
link_to 'show', animal >>undefined method `animal_path'


>> what is the correct way without hacking through classes and rewriting url helpers etc?

thx


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMd870TKyYVcc9bngqd14jMnBVjPLf0gfWb6K5Xyh8fmYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment