Class: Ishapi::VenuesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ishapi/venues_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#test

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
# File 'app/controllers/ishapi/venues_controller.rb', line 5

def index
  authorize! :index, ::Venue
  @venues = ::Venue.all
  if params[:cityname]
    city = City.find_by :cityname => params[:cityname]
    @venues = @venues.where( :city => city )
  end
end

#showObject



14
15
16
17
# File 'app/controllers/ishapi/venues_controller.rb', line 14

def show
  @venue = Venue.find_by :name_seo => params[:venuename]
  authorize! :show, @venue
end