[Hope this wont be a dubbel post]

My feeling is also that it dosent fire the ruby part of the script.
If i go to http://localhost:3000/javascripts/location_handler.js i
get
a No route matches "/javascripts/location_handler.js" error.

If i go to http://localhost:3000/javascripts/location_handler.js.erb i
see the
source code

...

function countrySelected() {
        country_id = $('account_country').getValue();

        var states = <%= @states.collect {|state| [state.country_id,
h(state.name)]}.to_json %>
        <% for state in @states -%>
        states.push(new Array(<%= state.country_id %>, '<%=h state.name %>', <
%= state.id %>));
        <% end -%>

        options = $('account_state').options;
        options.length = 1;
        states.each(function(state) {
            if (state[0] == country_id) {
              options[options.length] = new Option(state[1], state[2]);
            }
          });

}

function stateSelected() {

        options = $('account_city').options;
        options.length = 1;

}

...

I have added match ":controller(/:action(/:id(.:format)))" to my
routes.rb is there anything else i need to do ?

//Niklas

On 22 Feb, 16:47, Hassan Schroeder <[email protected]> wrote:
> On Tue, Feb 22, 2011 at 12:05 AM, Niklas Nson <[email protected]> wrote:
> > That gives me the error (in firebug)
>
> > illegal XML character
> > [Stop on error] var states = <%= @states.collect {|st...ountry_id,
> > h(state.name)]}.to_json %>
>
> If that's what the client is seeing, it would seem to indicate that your
> *.js.erb file is not actually being evaluated.
>
> Is there anything (errors) in your logs to indicate why that might be?
>
> --
> Hassan Schroeder ------------------------ [email protected]
> twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to