How do I use the .send method for a dynamic class to go to the specific path in Rails? -


i using following:

send("#{done_event.class.name.tableize}_path", done_event.id) 

an example done_event specific instance of contactemail.

i represent path contact_email_path(done_event.id) translate contact_emails/1

however, result contact_emails.1

not sure do...?

i error when try pass in object:

http://localhost:3000/contact_calls.%23%3ccontactcall:0x9fefb80%3e 

this seems trick:

send("#{done_event.class.name.tableize.singularize}_path", done_event) 

although if polymorphic worked, use that.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -