Sha256: bb1d5fb2e362126f0f1a3bf766707d12aa89f1bd92d8fafc6c5eed040e68c329
Contents?: true
Size: 972 Bytes
Versions: 7
Compression:
Stored size: 972 Bytes
Contents
class IntegrationSessionsController < ActionController::Base def new @user_id = params[:user_id] render file: File.expand_path('./../integration_sessions_form.html.erb', __FILE__), layout: false end def create sign_in_and_redirect User.friendly.find(params[:user_id]) end end #Copypasta from http://openhood.com/rails/rails%203/2010/07/20/add-routes-at-runtime-rails-3/ _routes = nil begin _routes = Dummy::Application.routes _routes.disable_clear_and_finalize = true _routes.clear! Dummy::Application.routes_reloader.paths.each{ |path| load(path) } _routes.draw do # here you can add any route you want post 'integration_sessions' => 'integration_sessions#create', :as => 'integration_sessions' get 'integration_sessions' => 'integration_sessions#new', :as => 'new_integration_sessions' end ActiveSupport.on_load(:action_controller) { _routes.finalize! } ensure _routes.disable_clear_and_finalize = false end
Version data entries
7 entries across 7 versions & 1 rubygems