don't try to add data to new models
This commit is contained in:
parent
8b98a0b4c6
commit
517c7d6937
|
@ -52,7 +52,12 @@ module SemanticRailsViewHelpers
|
||||||
route = model
|
route = model
|
||||||
route = route.to_route if route.respond_to?(:to_route)
|
route = route.to_route if route.respond_to?(:to_route)
|
||||||
|
|
||||||
link_to label, polymorphic_url(route, :action => action), options.merge(semantic_action_data(target_action).merge(semantic_model_data(model)))
|
data = semantic_action_data(target_action)
|
||||||
|
if action != :new
|
||||||
|
data.merge!(semantic_model_data(model))
|
||||||
|
end
|
||||||
|
|
||||||
|
link_to label, polymorphic_url(route, :action => action), options.merge(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def li_for(object, options = {}, &block)
|
def li_for(object, options = {}, &block)
|
||||||
|
|
Loading…
Reference in New Issue