AppleII717 wrote:
> As usual, the fastest way to figure something out is to post something
> on some help forum - then about 5 minutes after the post, the bell
> goes off.
>
> I almost had it right with:
>
> select_month(0,:include_blank => true, :html_options => {:onchange =>
> "setBirthMMDD"} )
>
> just needed:
>
> select_month(0, options = {:include_blank => true}, html_options =
> {:onchange =>
> "setBirthMMDD"} )
No. This actually assigns to local variables called options and
html_options, then uses the values of those assignments. What you
should do is
select_month(0, {:include_blank => true}, {:onchange => "setBirthMMDD"}
)
If this is hard to understand, review your basic Ruby syntax.
>
> Just as the rdoc documentation described. The rdoc documentation still
> causes me problems. It would have been helpful if they had at least
> one example in the date helper area that used html_options=. Any time
> I see a hash, I assume a => assignment.
And so you should. The issue here is that Ruby needs to know where one
hash ends and the other begins, which is why you need explicit braces.
>
> I at least figured out how to read (or pay closer attention) rdoc
> documentation a little better. There are just so many shortcut options
> that ruby or rails tries to figure out that it confuses the issue.
> Think I'll just be explicit from now on and avoid the shortcuts.
Unfortunately, in trying to do that, you made a potentially more serious
mistake (more serious because it might clobber local variables you're
using).
>
> Thank for the help.
>
> Steve
>
>
> On Sep 2, 6:44�am, Frederick Cheung <[email protected]>
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---