Guest User

Untitled

a guest
Feb 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class WebpagesController < ApplicationController
  2. # GET /webpages
  3. # GET /webpages.xml
  4. def index
  5. @webpage = Webpage.find(params[:page])
  6. # :find searches on id so :find_by_id is redundant
  7. # and will raise an exception if no such webpages exists
  8.  
  9. # @contents = @webpage.contents unless @webpage.nil?
  10. # you don't need this ivar (instance variable) since you already have @webpage
  11.  
  12. respond_to do |format|
  13. format.html # index.html.erb
  14. format.xml { render :xml => @webpages }
  15. end
  16. end
  17. end
Add Comment
Please, Sign In to add comment