To use one controller from another, do this:
def action_that_calls_one_from_another_controller
controller_you_want = ControllerYouWant.new
controller_you_want.request = request
controller_you_want.response = response
controller_you_want.action_you_want
end
More Related Contents:
- Boolean Validation
- WARNING: Can’t verify CSRF token authenticity rails
- How do I get the current absolute URL in Ruby on Rails?
- SSL Error When installing rubygems, Unable to pull data from ‘https://rubygems.org/
- What is the easiest way to duplicate an activerecord record?
- Rails 3.1 asset pipeline: how to load controller-specific scripts?
- rails – Devise – Handling – devise_error_messages
- How to solve error “Missing `secret_key_base` for ‘production’ environment” (Rails 4.1)
- How can I avoid running ActiveRecord callbacks?
- Rails 5: Load lib files in production
- How does instance_eval work and why does DHH hate it?
- test a file upload using rspec – rails
- How to query a model based on attribute of another model which belongs to the first model?
- Rails: ActiveRecord query based on association value
- Rails – How to use a Helper Inside a Controller
- Rails 4: assets not loading in production
- Overriding a module method from a gem in Rails
- Remove ActiveRecord in Rails 3
- Best Practices for reusing code between controllers in Ruby on Rails
- How do I set up the database.yml file in Rails?
- Rails: Default sort order for a rails model?
- Converting string from snake_case to CamelCase in Ruby
- Rails: How to list database tables/objects using the Rails console?
- pass parameter by link_to ruby on rails
- Controller spec unknown keyword: id
- First argument in form cannot contain nil or be empty – Rails 4
- Is it possible to refresh partial frequently using Ajax?
- Looking for suggestions for building a secure REST API within Ruby on Rails
- Sass import error in Rails 3 app – “File to import not found or unreadable: compass”
- How to integrate a Wrap Bootstrap theme into an Rails application?