app/controllers/prosperity/graphs_controller.rb in prosperity-0.0.8 vs app/controllers/prosperity/graphs_controller.rb in prosperity-0.0.9
- old
+ new
@@ -58,11 +58,11 @@
end
def create
@graph = Graph.new
[:title, :period, :graph_type].each do |attr|
- @graph.send("#{attr}=", graph_params[attr])
+ @graph.public_send("#{attr}=", graph_params[attr])
end
if @graph.save
redirect_to edit_graph_path(@graph)
else
@@ -78,10 +78,10 @@
end
def graph_params
if strong_params?
params.require(:graph).
- permit(Graph::ATTR_ACCESSIBLE + [:graph_lines_attributes => (GraphLine::ATTR_ACCESSIBLE + [:id])])
+ permit(Graph::ATTR_ACCESSIBLE + [:graph_lines_attributes => (GraphLine::ATTR_ACCESSIBLE + [:id, :_destroy])])
else
params.fetch(:graph, {})
end
end
end