Class: ReportTemplatesController

Inherits:
BaseJsonController show all
Defined in:
app/controllers/report_templates_controller.rb

Instance Method Summary (collapse)

Methods inherited from BaseJsonController

#create, #destroy, #show, #update

Instance Method Details

- (Object) index



26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/report_templates_controller.rb', line 26

def index
  begin
    @initiative = Initiative.find params[:initiative_id]
  rescue ActiveRecord::RecordNotFound => e
    flash[:notice] = "An error loading that initiative, please try again."
    respond_to do |format|
      format.html{ redirect_to initiatives_path and return }
      format.json{ render :json => ReportTemplate.accessible_by(current_ability).all }
    end
  end
  @metrics = Metric.mappable.all
end