Rails and Dojo

Hi there everyone,

How would I go about adding the dojoType to a rails text_area form
helper i.e.

<%= f.text_area :content %>

Regards,
Schalk

Not 100% sure since I’ve never tried Rails + Dojo, but as I recall
don’t most of the tags allow for additional HTML content to be
specified as a Hash? If so, couldn’t you pass the dojoType attribute
and value to that?

As I said I’ve never tried this, so it might not work depending on how
exactly the internals of Rails parses the values provided

  • Wayne

I Wayne,

Thank for the feedback. Yes, I saw that all the form helpers do show a
options = {} argument but when I try to do:

<%= f.text_area :content, options = {dooType=“someDojoType”} %>

I get a compile error. Can you show me what you mean by specifying
additional HTML content as a Hash?

Kind Regards,
Schalk N.

<%= f.text_area :content, :dooType => “someDojoType”, :id =>
“element_id” %>

Schalk N. wrote:

I Wayne,

Thank for the feedback. Yes, I saw that all the form helpers do show a
options = {} argument but when I try to do:

<%= f.text_area :content, options = {dooType=“someDojoType”} %>

I get a compile error. Can you show me what you mean by specifying
additional HTML content as a Hash?

Kind Regards,
Schalk N.

Ummmm I think he wanted the dooType attribute set on the text area
tax, not sent in through the params attribute (ie on the key-val
mappings of the URL line).

that would be

<%= f.text_area(:content, {:dooType => “someDojoType”}) %>

Here “content” would be the attribute of the object passed into the
form object “f”.

Is this what you wanted?

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
VIDEO #4 coming soon!
http://sensei.zenunit.com/

Yep.

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
VIDEO #4 coming soon!
http://sensei.zenunit.com/

Hi there,

In the end it was so simple I could kick myself:
<%= f.text_area :content, {dojoType = "dijit.Editor} %>

And Bob’s your uncle :slight_smile:

Regards,
Schalk

<%= f.text_area(:content, {:dooType => “someDojoType”}) %>

and

<%= f.text_area(:content, :dooType => “someDojoType”) %>

are the same thing. If the last argument is a hash, there is no need to
include the hash tags. Matter of personal preference, but I prefer it
without the explicit hash tags when they are not needed.

Julian L. wrote:

Ummmm I think he wanted the dooType attribute set on the text area
tax, not sent in through the params attribute (ie on the key-val
mappings of the URL line).

that would be

<%= f.text_area(:content, {:dooType => “someDojoType”}) %>

Here “content” would be the attribute of the object passed into the
form object “f”.

Is this what you wanted?

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
VIDEO #4 coming soon!
http://sensei.zenunit.com/

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