2014-08-06 14:47:47 +02:00
|
|
|
# Groups life cycle
|
2014-07-27 01:50:22 +02:00
|
|
|
class LugsController < ApplicationController
|
|
|
|
before_action :set_lug, only: [:show]
|
|
|
|
|
|
|
|
def index
|
|
|
|
@search = Lug.search params[:q]
|
|
|
|
@search.sorts = 'name' if @search.sorts.empty?
|
2014-08-06 14:47:47 +02:00
|
|
|
@lugs = @search.result.page params[:page]
|
2014-07-27 01:50:22 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
@search = Lug.search params[:q]
|
2014-10-13 22:50:59 +02:00
|
|
|
|
|
|
|
@events_future = Event.moderated.future.tag @lug.name
|
|
|
|
@events_past = Event.moderated.past.tag @lug.name
|
2014-07-27 01:50:22 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2014-08-06 14:47:47 +02:00
|
|
|
# Use callbacks to share common setup or constraints between actions.
|
|
|
|
def set_lug
|
|
|
|
@lug = Lug.find params[:id]
|
|
|
|
end
|
2014-07-27 01:50:22 +02:00
|
|
|
end
|