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_filter :show_authorized_filter, :only => :show
end

Instance Method Details

#showObject



7
8
9
10
11
12
13
14
15
16
17
18
# 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
  unless params.delete :destroy_action
    do_show
    successful?
    respond_to_action(:show)
  else
    @record = find_if_allowed(params[:id], :read) if params[:id] && params[:id] && params[:id].to_i > 0
    action_confirmation_respond_to_html(:destroy)
  end
end