Refactor: replace "render :json = graph.to_json" to view template(show.json.erb).
Because model shouldn't know about view logic.
This commit is contained in:
parent
9dc46eee8e
commit
2f7f46b256
5 changed files with 39 additions and 38 deletions
5
app/helpers/graph_helper.rb
Normal file
5
app/helpers/graph_helper.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
module GraphHelper
|
||||
def join_with_space(ary)
|
||||
ary.collect{|r|r.name}.join(" ") unless ary.nil?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue