Sha256: 69a6a37ab35fb30d7e9f2c4beab51040cc57de4bdf9adc328a70125879124e6a
Contents?: true
Size: 1.36 KB
Versions: 1
Compression:
Stored size: 1.36 KB
Contents
class ReportsController < ApplicationController before_action :set_report, only: [:show, :edit, :update, :destroy] def index @reports = Report.all.page(params[:page]).per(50) end def show @data = @report.report_date(params) #@result = @report.get_chart_date(params) if @report.template.blank? render text: "没有模板,请先添加report模板" else render @report.template end end def new @report = Report.new end def edit end def create @report = Report.new(report_params) respond_to do |format| if @report.save format.html { redirect_to reports_url, notice: '添加成功' } else format.html { render :new } end end end def update respond_to do |format| if @report.update(report_params) format.html { redirect_to reports_url, notice: '修改成功' } else format.html { render :edit } end end end def destroy @report.destroy respond_to do |format| format.html { redirect_to reports_url, notice: '删除成功' } end end private def set_report @report = Report.find(params[:id]) end def report_params params.require(:report).permit(:name, :sql_code, :is_sql_category, :category_name, :connect_id, :template, :url) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
admin-sys-1.1.0 | plugins/report/app/controllers/reports_controller.rb |