module ComponentParty::ActionView::Renderer
Public Instance Methods
normalize_component_path!(_context, options)
click to toggle source
An example of options argumento passed by Rails are {
:prefixes=>["devise/sessions", "devise", "application"], :template=>"new", :layout=> a Proc
}
# File lib/component_party/action_view/renderer.rb, line 31 def normalize_component_path!(_context, options) if options[:component] == true options[:component] = Pathname.new(options[:prefixes].first.to_s).join(options[:template]).to_s options[:prefixes] = [ComponentParty.configuration.component_folder_for_actions] else options[:component] options[:prefixes] = [] end end
normalize_data_for_component_rendering!(context, options)
click to toggle source
# File lib/component_party/action_view/renderer.rb, line 20 def normalize_data_for_component_rendering!(context, options) normalize_component_path!(context, options) context.instance_variable_set('@current_component_path', options[:component]) end