Skip to content

Instantly share code, notes, and snippets.

@JonasNielsen
Created February 28, 2010 08:51
Show Gist options
  • Save JonasNielsen/317495 to your computer and use it in GitHub Desktop.
Save JonasNielsen/317495 to your computer and use it in GitHub Desktop.
# ERROR RETURNED ---------
ActionView::TemplateError (ActionView::Helpers::JavaScriptProxy#to_str should return String) on line #7 of app/views/topics/create.rjs:
4: page.replace_html :notice, flash[:notice]
5: flash.discard
6:
7: page.create_topics_sortable()
app/helpers/topics_helper.rb:7:in `create_topics_sortable'
app/views/topics/create.rjs:7:in `_run_rjs_app47views47topics47create46rjs'
app/views/topics/create.rjs:1:in `_run_rjs_app47views47topics47create46rjs'
haml (2.2.18) lib/haml/helpers/action_view_mods.rb:13:in `render'
app/controllers/topics_controller.rb:23:in `create'
haml (2.2.18) lib/sass/plugin/rails.rb:19:in `process'
#This works
page.replace_html('sortable_list_control', sortable_element('topics', :url => sort_topics_path))
#This doesn't
page.create_topics_sortable()
include ActionView::Helpers::ScriptaculousHelper
module TopicsHelper
def create_topics_sortable
page.replace_html('sortable_list_control', sortable_element('topics', :url => sort_topics_path))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment