Sha256: fa3a5d45b5d86ee85818dbd7397f4503ec65eef79b84e0bbbbfdca5a14e82f08

Contents?: true

Size: 691 Bytes

Versions: 12

Compression:

Stored size: 691 Bytes

Contents

module Coprl::Presenters::WebClient::Helpers::Rails
  module Partials
    # Called by built in views
    def partial(template, *args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      options.merge!(partial: template)
      # Rails does not support the views parameter ... but sinatra does so we clean it up here
      options.delete(:views)
      render options
    end

    # Called by plugins
    def render_partial(_engine, template, options = {}, locals = {}, &block)
      # Rails does not support the views parameter ... but sinatra does so we clean it up here
      options.delete(:views)
      options.merge!(partial: template.to_s)
      render options
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.11 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.10 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.9 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.8 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.7 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.6 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.5 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.4 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.3 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.2 lib/coprl/presenters/web_client/helpers/rails/partials.rb
coprl-3.0.0.beta.1 lib/coprl/presenters/web_client/helpers/rails/partials.rb