Re: Need Help With Datebock plugin

Nathaniel Brown
Fri, 23 Mar 2007 10:44:33 -0000

Hey dlo,

Thanks for asking. Seems you have run across a bug I didn''t catch
earlier, and I managed to squash a couple more while I was at it as
well.

If you update the plugin with the latest code at...

http://svn.toolbocks.com/plugins/datetime_toolbocks/

You''ll get v3.0.1, which has it fixed. The website even has a few more
samples of what you can do as well.

Also...

<%= toolbocks_date_select ''table_rate'',
''start_date'', { :value =>
session[:startdate] } %>

Should be what you are after. You might need to pass in a format as
well, depending on how you want it to look. Options for that are:

[''dd/mm/yyyy'',  ''dd-mm-yyyy'',
''mm/dd/yyyy'', ''mm.dd.yyyy'',
''yyyy-mm-dd'', ''iso'', ''de'',
''us'']

Nathaniel.

On 3/22/07, dlo
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> Ok Nathaniel,
>
> I''m going to need your help.  I''m TOOO much of a noob
here.  Ok so after
> following the instructions on http://datetime.toolbocks.com/ which
> differ from the README a little, I still can''t get the control to
show.
> Ok so I''m ok up to I guess step 5.  Am I suppose to add
> toolbocks_date_select(''event'',
''start_date'') to a helper.rb?  Or, just
> start using it as is in a view.  For example here is my code in my
> partial form:
>
> <!--<%= date_select ''table_rate'',
''start_date'', :start_year => 2007,
> :order => [:month, :day, :year], :use_month_numbers => true, :value
=>
> session[:startdate] %>-->
>      <%= toolbocks_date_select :table_rate, :start_date, { :format =>
> ''us'', :autoRollOver => false} %>
>
> Model Name is table_rate.rb and I want the name of the control to be
> start_date.
>
> The commented code is the original date_select code.  Am I using it
> right? Am I forgetting anything?  I did add the config.plugins to my
> environment.rb.  Nothing shows up on my view.  If I view my pagesource I
> see this:
>
>
>         new DatetimeToolbocks({
>           elementId:
''DatetimeToolbocksTable_rateStart_date'',
>           inputName: ''table_rate[start_date]'',
>           inputValue: '''',
>           showHelp: ,
>           format: ''us'',
>           autoRollOver: false,
>           calendarOptions: {align:"''Br''"}
>         });
>
>
> You''ve been a lot of help already, but I guess I just need that
extra
> step.  Thanks
> dlo
>
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647
Vancouver: 604-724-6624