hello,
i've got the STI-hierarchy Dictionary, InternalDictionary < Dictionary
and OnlineDictionary < Dictionary.
Every submodel has its own controller. E.g. InternalDictionary is
handled by
Voc::InternalDictionaryController. As you see everything works inside
the namespace Voc (except the models).
In an index.html.erb of a controller i walk through all types of
dictionaries:
<% for dictionary in @dictionaries %>
<tr>
<td><%= link_to 'Edit', [:voc,dictionary], :method => :get %></td>
</tr>
<% end %>
This leads to the path "voc_internal_dictionary" for objecs of type
InternalDictionary and to "voc_online_dictionary" for objects of type
OnlineDictionary. So far so good.
But I want to call the method "edit" or a methodname completely
different from the CRUD-names.I'd need something like
<td><%= link_to 'Edit', [:voc,dictionary], :action => "edit" %></td>
I tried:
<td><%= link_to 'Edit',edit_voc_dictionary_path %></td>
but that doens't behave polymorphic and calls the edit method of the
dictionary-controller directly.
Any ideas?
Thanks a lot
Lutz
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---