Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WebpagesController < ApplicationController
- # GET /webpages
- # GET /webpages.xml
- def index
- @webpage = Webpage.find(params[:page])
- # :find searches on id so :find_by_id is redundant
- # and will raise an exception if no such webpages exists
- # @contents = @webpage.contents unless @webpage.nil?
- # you don't need this ivar (instance variable) since you already have @webpage
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @webpages }
- end
- end
- end
Add Comment
Please, Sign In to add comment