Guest User

Untitled

a guest
Jun 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. ## Controller
  2. class SomeController < ApplicationController
  3.  
  4. def index
  5. @thing = Thing.first
  6. redirect_to :action => 'show', :id => @thing
  7. end
  8.  
  9. def show
  10. @thing = Thing.find(param[:id])
  11. end
  12. end
  13.  
  14. ## routes.rb
  15.  
  16. map.root :controller => :some_controller, :action => :index
  17. map.connect ':controller/:action/:id'
Add Comment
Please, Sign In to add comment