Sha256: 8ebcec0c49ba20e783a1f39103c7d6e9ecc55ad93c107f1a729bd01b9f73de83

Contents?: true

Size: 678 Bytes

Versions: 9

Compression:

Stored size: 678 Bytes

Contents

module HowTo
  class ApplicationController < ::ApplicationController
    #layout :how_to_layout
    helper_method :can_manage_how_to?

    def can_manage_how_to?
      self.send(HowTo.config.permitted_to_manage_how_to.to_sym) rescue false
    end

    def authorise_how_to_manage!
      self.send(HowTo.config.authorization_method_to_manage.to_sym) rescue false
    end

    def authorise_how_to_view!
      self.send(HowTo.config.authorization_method_to_view.to_sym) rescue true
    end

    def how_to_layout
      if template_exists?(HowTo.config.layout_name, "layouts/how_tos")
        "how_to/#{HowTo.config.layout_name}"
      else
        nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
how_to-2.0.5 app/controllers/how_to/application_controller.rb
how_to-2.0.4 app/controllers/how_to/application_controller.rb
how_to-2.0.3 app/controllers/how_to/application_controller.rb
how_to-2.0.2 app/controllers/how_to/application_controller.rb
how_to-2.0.1 app/controllers/how_to/application_controller.rb
how_to-2.0.0 app/controllers/how_to/application_controller.rb
how_to-1.0.3 app/controllers/how_to/application_controller.rb
how_to-1.0.2 app/controllers/how_to/application_controller.rb
how_to-0.0.8 app/controllers/how_to/application_controller.rb