Skip to content

Instantly share code, notes, and snippets.

@adbatista
Created October 8, 2014 17:18
Show Gist options
  • Save adbatista/3acfcfb2097ba0f45c2a to your computer and use it in GitHub Desktop.
Save adbatista/3acfcfb2097ba0f45c2a to your computer and use it in GitHub Desktop.
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