Module: ActiveScaffold::Actions::Revision

Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/revision.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/revision.rb', line 6

def self.included(base)
  base.before_filter :revision_authorized?, :only => :revision
end

Instance Method Details

#next_revisionObject



23
24
25
26
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/revision.rb', line 23

def next_revision
  @revision_number = params[:revision_number].to_i + 2 if params[:revision_number]
  revision
end

#previous_revisionObject



28
29
30
31
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/revision.rb', line 28

def previous_revision
  @revision_number = params[:revision_number].to_i - 2 if params[:revision_number]
  revision
end

#revisionObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/revision.rb', line 10

def revision
  do_revision

  successful?
  respond_to do |type|
    type.html { render :action => 'revision', :layout => true }
    type.js { render :partial => 'revision', :layout => false }
    type.xml { render :xml => response_object.to_xml, :content_type => Mime::XML, :status => response_status }
    type.json { render :text => response_object.to_json, :content_type => Mime::JSON, :status => response_status }
    type.yaml { render :text => response_object.to_yaml, :content_type => Mime::YAML, :status => response_status }
  end
end