Trying to set text_area helper class for css => getting weirdness

here’s my view code:

<%= f.text_area :notes, :cols => 40, :rows => 15, :class => ‘focus’ %>

here’s what firefox shows is being gen’d:

note that I’m ending up with a class = “focus text_area” instead of
the expected “focus”

It doesnt look like I’m doing anything wrong, but… am I?

On Thu, Mar 4, 2010 at 4:10 AM, lunaclaire [email protected] wrote:

the expected “focus”

It doesnt look like I’m doing anything wrong, but… am I?

You are not doing anything wrong, and there is nothing wrong with the
piece of code generated by rails. This is only saying that your
element as two classes: ‘text_area’, which is used by rails, and
‘focus’.


Gael Muller

Ahh… good pt.

The thing is, I’m using this with some new jQuery stuff I’m doing
where that code looks for input elements with a class == ‘focus’…
Guess I’ll have to change that to look for elements containing that
class.

But, I’m curious why I dont get the dame thing for text_fields…
there the class just comes out as ‘focus’.

Any ideas about that?

Ahh… good pt.

The thing is, I’m using this with some new jQuery stuff I’m doing
where that code looks for input elements with a class == ‘focus’…
Guess I’ll have to change that to look for elements containing that
class.

But, I’m curious why I dont get the dame thing for text_fields…
there the class just comes out as ‘focus’.

Any ideas about that?

Ahh… good pt.

The thing is, I’m using this with some new jQuery stuff I’m doing
where that code looks for input elements with a class == ‘focus’…
Guess I’ll have to change that to look for elements containing that
class.

But, I’m curious why I dont get the dame thing for text_fields…
there the class just comes out as ‘focus’.

Any ideas about that?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs