Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Controller concerts/verified
- @concerts = concert.paginate :page => page, :order => order, :per_page => per_page, :conditions => ["active = :active AND verified = :verified AND (end > :now OR start > :now)", {:active => true, :verified => true, :now => Time.zone.now} ]
- @today = @concerts.collect do |concert|
- lambda {
- if concert.start.present?
- return concert if (concert.start.strftime("%Y%m%d") == today)
- end
- }.call
- end
- ## View verified.html.erb
- <h2>Today</h2>
- <%= render :partial => "concert", :layout => "window", :collection => @today %>
- <h2>All protests</h2>
- <%= render :partial => "concert", :layout => "window", :collection => @concerts %>
- ## Layout _window.html.erb
- <table>
- <tr>
- <th>status</th>
- <th>options</th>
- <th>location</th>
- <th>begins</th>
- </tr>
- <%= yield %>
- </table>
- </div>
- <%= will_paginate @concerts %>
Add Comment
Please, Sign In to add comment