Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PagingController < ApplicationController
- def index
- @pages = Paging.all
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @pages }
- end
- end
- # POST /posts
- # POST /posts.json
- def new
- @page = Paging.new
- end
- def create
- @page = Paging.new(params[:page])
- respond_to do |format|
- if @page.save
- format.html { redirect_to paging_path, notice: 'Post was successfully created.' }
- format.json { render json: @page, status: :created, location: @page }
- format.js
- else
- format.html { render action: "index" }
- format.json { render json: @page.errors, status: :unprocessable_entity }
- end
- end
- end
- # DELETE /posts/1
- # DELETE /posts/1.json
- def destroy
- @page = Paging.find(params[:id])
- @paging.destroy
- respond_to do |format|
- format.html { redirect_to paging_path }
- format.json { head :no_content }
- format.js
- end
- end
- end
Add Comment
Please, Sign In to add comment