Created
October 8, 2014 17:18
-
-
Save adbatista/3acfcfb2097ba0f45c2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rails" | |
require "action_controller/railtie" | |
class SampleFile < Rails::Application | |
config.secret_key_base = "pa34u13hsleuowi1aisejkez12u39201pluaep2ejlkwhkj" | |
routes.append do | |
root to: 'foo#index' | |
get 'foo/bar' | |
end | |
initialize! | |
end | |
class FooController < ActionController::Base | |
include Rails.application.routes.url_helpers | |
def index | |
redirect_to controller: :foo, action: :bar, status: 'FOO' | |
end | |
def bar | |
render text: "HEY #{params[:status]}" | |
end | |
end | |
run Rails.application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment