Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.35 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to execute a controller/action in Rails?
  2. #lib/foo_controller_includes.rb
  3. module FooControllerIncludes
  4.    def special_edit
  5.       do_some_stuff!
  6.       render :action=>"/full/path/to/file"
  7.    end
  8. end
  9.  
  10. #app/controllers/bar_controller.b
  11. class BarController < ApplicationController
  12.   include FooControllerIncludes
  13.  
  14.   def edit
  15.      special_edit
  16.   end
  17. end