lib/ruhl/rails/ruhl_presenter.rb in ruhl-1.1.0 vs lib/ruhl/rails/ruhl_presenter.rb in ruhl-1.1.1
- old
+ new
@@ -48,15 +48,12 @@
def present(options = {})
action_sym = options[:action] || action_name
object_sym = options[:object] || controller_name.singularize
- params = { :template => "#{controller_name}/#{action_sym}",
- :locals => {:object => presenter_for(object_sym) } }
- params[:layout] = options[:layout] if options.has_key?(:layout)
-
- render params
+ render :template => "#{controller_name}/#{action_sym}",
+ :locals => {:object => presenter_for(object_sym), :layout => options[:layout] }
end
def presenter_for(object)
if object.is_a?(Symbol) || object.is_a?(String)