mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
small refactorings of generated javascripts
This commit is contained in:
parent
8a3cb66e49
commit
6191cce4c7
33 changed files with 125 additions and 124 deletions
|
|
@ -242,8 +242,16 @@ module ApplicationHelper
|
|||
"#{name}_#{SecureRandom.hex(5)}"
|
||||
end
|
||||
|
||||
def js_render(object, locals = {})
|
||||
escape_javascript(render(partial: object, locals: locals))
|
||||
def js_render(partial, locals = {}, object=nil)
|
||||
if object
|
||||
escape_javascript(render(partial: partial, locals: locals, object: object))
|
||||
else
|
||||
escape_javascript(render(partial: partial, locals: locals))
|
||||
end
|
||||
end
|
||||
|
||||
def js_error_messages_for(object)
|
||||
escape_javascript(get_list_of_error_messages_for(object))
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue