Topic: RJS action not recognized in shared-hosting environment

Hi, I have a not-directly-related follow-up to a question I asked a few days ago.

I have a drop-down list in a form:

<%= select_tag :advertformat, options_for_select(["", "Micro Bar", "Square Button",]), \
:onChange => "new Ajax.Request(this.value, {asynchronous:true, evalScripts:true})" %>

This works fine on my laptop, calling e.g. the "square button.rjs" action (excerpt from development log):
Parameters: {"action"=>"Square Button", "controller"=>"adverts"}
Rendering adverts/Square Button

But it stops working as soon as I upload the app to my shared-hosting server (excerpt from production log):
Parameters: {"action"=>"Square Button", "controller"=>"adverts"}
ActionController::UnknownAction (No action responded to Square Button)

Any ideas how I can go about fixing this?

Re: RJS action not recognized in shared-hosting environment

Action names shouldn't have spaces in them. Instead you'll have to replace the spaces with underescores. Try something like this:

options_for_select([["", ""], ["Micro Bar", "micro_bar"], ["Square Button", "square_button"]])

Railscasts - Free Ruby on Rails Screencasts

Re: RJS action not recognized in shared-hosting environment

Yay, that worked. As ever, thank you so much Ryan.