Class: Usman::RegistrationDevicesController

Inherits:
ResourceController show all
Defined in:
app/controllers/usman/registration_devices_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/usman/registration_devices_controller.rb', line 7

def index
  get_collections
  respond_to do |format|
    format.html {}
    format.js  { 
      js_view_path = @resource_options && @resource_options[:js_view_path] ? "#{@resource_options[:js_view_path]}/index" : :index 
      render js_view_path
    }
  end
end

#showObject



18
19
20
21
22
# File 'app/controllers/usman/registration_devices_controller.rb', line 18

def show
  @device = @r_object = @resource_options[:class].find_by_id(params[:id])
  set_notification(false, I18n.t('status.error'), I18n.t('status.not_found', item: default_item_name.titleize)) unless @r_object
  render_accordingly
end