Guest User

Untitled

a guest
Jul 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. def index
  2. @specific = Date.new(params[:year].to_i ||= 2009, params[:month].to_i ||= 01, params[:day].to_i ||= 01)
  3. if params[:day]
  4. @entries = Entry.by_day(@specific)
  5. else if params[:month]
  6. @entries = Entry.by_month(@specific)
  7. else if params[:year]
  8. @entries = Entry.by_year(@specific)
  9. else
  10. @entries = Entry.all
  11. end
  12.  
  13. respond_to do |format|
  14. format.html # index.html.erb
  15. format.xml { render :xml => @entries }
  16. end
  17. end
Add Comment
Please, Sign In to add comment