Reputation: 1879
I'm using rails 3 with bundler, I installed a gem using bundler, now I need to modify the flow of the gem slightly by modifying the controller of the gem, how am I supposed to do so, i'm sure there is a command to install the files locally so I can modify it, I tried to override the controller by creating another controller with the same name but sounds not working .
Upvotes: 1
Views: 2011
Reputation: 55012
Fork it on github, make the changes and point your gemfile to the forked repo like so:
gem "contact-us", :git => "git://github.com/eqbal/contact-us.git"
Upvotes: 9
Reputation: 17470
You should just be able to make a controller, inherit from the gem controller and override the method behavior as you see fit
class MyController < ContactUs::ContactsController
def create
# my code that changes the behavior
end
end
And then you may have to tell your routes to go to your controller
resources :contacts,
:controller => 'my_controller'
Upvotes: 3