Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## controller
- class PagesController < ResourceController::Base
- update.response do |wants|
- wants.html { redirect_to root_url }
- end
- def home
- @page = Page.find_by_title("home")
- end
- def details
- @page = Page.find_by_title("details")
- end
- def details2
- @page = Page.find_by_title("details2")
- end
- end
- ## view
- - form_for(@page, :url => object_url, :html => { :method => :put }) do |f|
- %p
- = f.text_area :text
- %p
- = f.submit "submit"
- ## routes
- ActionController::Routing::Routes.draw do |map|
- map.login "login", :controller => "user_sessions", :action => "new"
- map.logout "logout", :controller => "user_sessions", :action => "destroy"
- map.resources :user_sessions
- map.resources :users
- map.details '/', :controller => 'pages', :action => 'home'
- map.details '/details', :controller => 'pages', :action => 'details'
- map.details2 '/details2', :controller => 'pages', :action => 'details2'
- map.root :controller => "pages", :action => "home"
- map.resources :pages
- end
Add Comment
Please, Sign In to add comment