I have an existing Ruby On Rails, which works fine (I inherited it).
I need to add some functionality to the application and I built a model and controller and I want a button press to route to the controller.
I figure I need to do something like:
<%= form_tag(url_for(:controller => “do_something”, :action => “sup”), …
I have a controller that looks like:
class DoSomething < ApplicationController
…
end
How do I tell the framework that pushing that button fires the controller?
You don’t fire a controller; you fire an action within that controller.
Then in your
config/routes.rb, have a route that points to that action:Then in your view file,
or