DDDD
DDDD

Reputation: 3940

Options for running controller method from view

Ruby on Rails 3.2: I made a table, a model and controller. I want to run the "new" method in my controller. Off the top of my head I can think of a form to run the method. What other options are there to run controller methods?

In particular I would like to run the "new" method when viewing certain view files. Thank you

Upvotes: 0

Views: 27

Answers (1)

eduardosasso
eduardosasso

Reputation: 527

Well, you can add the new action to a link, use a form, and call the action using Ajax. Any other alternative other than those will violate MVC.

Upvotes: 1

Related Questions