Module: ActiveScaffold::Actions::Show

Defined in:
lib/active_scaffold/actions/show.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/active_scaffold/actions/show.rb', line 3

def self.included(base)
  base.before_action :show_authorized_filter, :only => :show
end

Instance Method Details

#showObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/active_scaffold/actions/show.rb', line 7

def show
  # rest destroy falls back to rest show in case of disabled javascript
  # just render action_confirmation message for destroy
  if params.delete :destroy_action
    @record = find_if_allowed(params[:id], :read) if params[:id]
    action_confirmation_respond_to_html(:destroy)
  else
    do_show
    respond_to_action(:show)
  end
end