Class: Birdses::PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Birdses::PagesController
- Defined in:
- app/controllers/birdses/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 |
# File 'app/controllers/birdses/pages_controller.rb', line 16 def create name = params[:page][:name].gsub(/\//, '-') content = params[:page][:raw_data] @page = Page.create(name, content, @user) redirect_to "#{pages_path}/#{name}" end |
#destroy ⇒ Object
30 31 32 33 |
# File 'app/controllers/birdses/pages_controller.rb', line 30 def destroy Page.destroy(params[:id], @user) redirect_to pages_path end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/birdses/pages_controller.rb', line 8 def index @pages = Page.all end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/birdses/pages_controller.rb', line 12 def new @page = Page.new end |