Sha256: a2c257ce3126df5937e95a0f7dc75912e1d65180b0af590c5782c48cc65a516d

Contents?: true

Size: 855 Bytes

Versions: 15

Compression:

Stored size: 855 Bytes

Contents

class RedmineCrmController < ApplicationController
  layout 'admin'

  before_action :require_admin
  require_sudo_mode :settings if respond_to?(:require_sudo_mode)

  def settings
    @section = RedmineCrm::Settings::SECTIONS[params[:id]]
    return render_404 unless @section

    if request.post?
      setting =
        if params[:settings].present?
          params[:settings].respond_to?(:to_unsafe_hash) ? params[:settings].to_unsafe_hash : params[:settings]
        else
          {}
        end
      RedmineCrm::Settings.apply = setting
      flash[:notice] = l(:notice_successful_update)
      redirect_to redmine_crm_settings_path(@section[:id])
    else
      @settings = RedmineCrm::Settings.values
    end
    @section_tabs = RedmineCrm::Settings::SECTIONS.map { |_n, s| { name: s[:id], partial: s[:partial], label: s[:label] } }
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
redmine_crm-0.0.63 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.62 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.61 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.60 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.59 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.58 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.57 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.56 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.55 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.54 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.53 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.52 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.51 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.50 app/controllers/redmine_crm_controller.rb
redmine_crm-0.0.49 app/controllers/redmine_crm_controller.rb