First day on rails...and already hamstrung!


#1

I’m reading along with “Ajax on Rails” (2007) and the first exercise
goes like this:

rails example
cd example
script/generate controller chap2 myaction
script/server

Then editing example/app/views/myaction.html.erb to look like this:

Hello World?

Firebug then says fone() is not defined. In the book the script is
after the html but this does not matter.

What’s the deal? I have not tried src’ing an external script (as I am
not sure where I would put that). I can’t really proceed if the js in
the view is just going to be ignored. I also added the
language=“javascript”, as this seems to be necessary sometimes in normal
html pages, but this does not help.


#2

On Mon, May 18, 2009 at 11:45 AM, Mk 27
removed_email_address@domain.invalid wrote:

I’m reading along with “Ajax on Rails” (2007)

a bit old, but …

and the first exercise goes like this:

Then editing example/app/views/myaction.html.erb to look like this:

What’s the deal? I have not tried src’ing an external script (as I am
not sure where I would put that). I can’t really proceed if the js in
the view is just going to be ignored. I also added the
language=“javascript”, as this seems to be necessary sometimes in normal
html pages, but this does not help.

  1. the language attribute is not only not “necessary”, it’s deprecated;
    don’t use it.

  2. spell text/javascript correctly and it should work as intended.

HTH,

Hassan S. ------------------------ removed_email_address@domain.invalid


#3

Hassan S. wrote:

  1. the language attribute is not only not “necessary”, it’s deprecated;
    don’t use it.

Thanks.

  1. spell text/javascript correctly and it should work as intended.

Sheesh. New things make me crazy paranoid.