Class: Ishapi::NewsitemsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#home, #long_term_token, #test

Instance Method Details

#indexObject

before_action :check_multiprofile, only: [ :index ]



9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/ishapi/newsitems_controller.rb', line 9

def index
  if params[:domain]
    resource = Site.find_by( :domain => params[:domain], :lang => :en )
  else
    resource = current_user.profile
  end

  authorize! :show, resource
  @newsitems = current_user.profile.newsitems
end