# class PagesController

### Public Instance Methods

create() click to toggle source

POST /pages POST /pages.json

    # File app/controllers/pages_controller.rb, line 42
    def create
      @page = Page.new(params[:page])

      respond_to do |format|
        if @page.save
          format.html { redirect_to @page, notice: 'Page was successfully created.' }
          format.json { render json: @page, status: :created, location: @page }
        else
          format.html { render action: "new" }
          format.json { render json: @page.errors, status: :unprocessable_entity }
        end
      end
    end

destroy() click to toggle source

DELETE /pages/1 DELETE /pages/1.json

    # File app/controllers/pages_controller.rb, line 74
    def destroy
      @page = Page.find(params[:id])
      @page.destroy

      respond_to do |format|
        format.html { redirect_to pages_url }
        format.json { head :no_content }
      end
    end

edit() click to toggle source

GET /pages/1/edit

    # File app/controllers/pages_controller.rb, line 36
    def edit
      @page = Page.find(params[:id])
    end

index() click to toggle source

GET /pages GET /pages.json

    # File app/controllers/pages_controller.rb, line 4
    def index
      @pages = Page.all

      respond_to do |format|
        format.html # index.html.erb

        format.json { render json: @pages }
      end
    end

new() click to toggle source

GET /pages/new GET /pages/new.json

    # File app/controllers/pages_controller.rb, line 26
    def new
      @page = Page.new

      respond_to do |format|
        format.html # new.html.erb

        format.json { render json: @page }
      end
    end

show() click to toggle source

GET /pages/1 GET /pages/1.json

    # File app/controllers/pages_controller.rb, line 15
    def show
      @page = Page.find(params[:id])

      respond_to do |format|
        format.html # show.html.erb

        format.json { render json: @page }
      end
    end

update() click to toggle source

PUT /pages/1 PUT /pages/1.json

    # File app/controllers/pages_controller.rb, line 58
    def update
      @page = Page.find(params[:id])

      respond_to do |format|
        if @page.update_attributes(params[:page])
          format.html { redirect_to @page, notice: 'Page was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: "edit" }
          format.json { render json: @page.errors, status: :unprocessable_entity }
        end
      end
    end