Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def index
- @specific = Date.new(params[:year].to_i ||= 2009, params[:month].to_i ||= 01, params[:day].to_i ||= 01)
- if params[:day]
- @entries = Entry.by_day(@specific)
- else if params[:month]
- @entries = Entry.by_month(@specific)
- else if params[:year]
- @entries = Entry.by_year(@specific)
- else
- @entries = Entry.all
- end
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @entries }
- end
- end
Add Comment
Please, Sign In to add comment