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:
Sato Hiroyuki 2013-03-06 20:31:28 +09:00
parent 9dc46eee8e
commit 2f7f46b256
5 changed files with 39 additions and 38 deletions

View file

@ -0,0 +1,5 @@
module GraphHelper
def join_with_space(ary)
ary.collect{|r|r.name}.join(" ") unless ary.nil?
end
end