I''m trying to follow these instructions to include the Javascript
progress bar on a page. However, I''m confused.
In my controller, when I try to access
update_upload_progress_bar_js
which is defined in
actionpack/lib/action_view/helpers/upload_progress_helper.rb
I get a "no such method" error.
Can I use helpers in my controller class and, if so, how do I access
them?
Thanks,
Wes
========================================================
upload_progress_update_bar_js(percent=nil)
Javascript helper that will create a script that will change the width
of the background progress bar container. Include this in the script
portion of your view rendered by your upload_status action to
automatically find and update the progress bar.
Example (in controller):
def upload_status
render :inline => "<script><%=
update_upload_progress_bar_js
%></script>", :layout => false
end
--
Posted via http://www.ruby-forum.com/.
OK I just realized a fundamental misunderstanding that I had - that the controller was invoking the helper, which of course it isn''t. So now I just have to figure out why the helper class can''t be found. WG Wes Gamble wrote:> I''m trying to follow these instructions to include the Javascript > progress bar on a page. However, I''m confused. > > In my controller, when I try to access > > update_upload_progress_bar_js > > which is defined in > > actionpack/lib/action_view/helpers/upload_progress_helper.rb > > I get a "no such method" error. > > Can I use helpers in my controller class and, if so, how do I access > them? > > Thanks, > Wes > > ========================================================> > upload_progress_update_bar_js(percent=nil) > > Javascript helper that will create a script that will change the width > of the background progress bar container. Include this in the script > portion of your view rendered by your upload_status action to > automatically find and update the progress bar. > > Example (in controller): > > def upload_status > render :inline => "<script><%= update_upload_progress_bar_js > %></script>", :layout => false > end-- Posted via http://www.ruby-forum.com/.
There''s an error in the documentation - the method name is upload_progress_update_bar_js How do I report a doc. error like this? Wes Wes Gamble wrote:> OK I just realized a fundamental misunderstanding that I had - that the > controller was invoking the helper, which of course it isn''t. > > So now I just have to figure out why the helper class can''t be found. > > WG > > Wes Gamble wrote: >> I''m trying to follow these instructions to include the Javascript >> progress bar on a page. However, I''m confused. >> >> In my controller, when I try to access >> >> update_upload_progress_bar_js >> >> which is defined in >> >> actionpack/lib/action_view/helpers/upload_progress_helper.rb >> >> I get a "no such method" error. >> >> Can I use helpers in my controller class and, if so, how do I access >> them? >> >> Thanks, >> Wes >> >> ========================================================>> >> upload_progress_update_bar_js(percent=nil) >> >> Javascript helper that will create a script that will change the width >> of the background progress bar container. Include this in the script >> portion of your view rendered by your upload_status action to >> automatically find and update the progress bar. >> >> Example (in controller): >> >> def upload_status >> render :inline => "<script><%= update_upload_progress_bar_js >> %></script>", :layout => false >> end-- Posted via http://www.ruby-forum.com/.