Forum: Ruby on Rails Upload progress update bar question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-08 19:02
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
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-08 19:04
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
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-08 21:28
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
This topic is locked and can not be replied to.