[Rails] Re: Upload progress update bar question

Wes Gamble
Wed, 08 Mar 2006 18:04:43 -0000

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 => " <%=
update_upload_progress_bar_js
> %> ", :layout => false
>   end