Sha256: 2551bc39f0f9bd3b956a16165d83ec0ab11a97b833917bb10ddcb3195287e43a

Contents?: true

Size: 276 Bytes

Versions: 4

Compression:

Stored size: 276 Bytes

Contents

module PostViewForAction
  extend ActiveSupport::Concern

  def post_view_for_action(action)
    if File.exist?(Rails.root.join("app/views/#{@config.key}/#{action}.html.erb"))
      return "/#{@config.key}/#{action}"
    else
      return "/posts/#{action}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tb_blog-1.3.5 app/controllers/concerns/post_view_for_action.rb
tb_blog-1.4.0 app/controllers/concerns/post_view_for_action.rb
tb_blog-1.3.4 app/controllers/concerns/post_view_for_action.rb
tb_blog-1.4.beta1 app/controllers/concerns/post_view_for_action.rb