How to use datepicker


#1

This is the webpage:
http://projects.exactlyoneturtle.com/date_picker/

I have downloaded and installed it. But how do I use in view page?

This is the usual view with ordinary datetime_select:

Date available
<%= datetime_select 'product', 'date_available' %>

So I have table named ‘product’ with one of the column named
‘date_available’. How do I use date_picker rather than
datetime_select?

The author give html page not rhtml page.

Thanks.


#2

Hi !

2006/3/31, Akbar removed_email_address@domain.invalid:

‘date_available’. How do I use date_picker rather than
datetime_select?

The author give html page not rhtml page.

You’ll need to copy the helper. This should really be packaged as a
plugin, but it’s not at the moment. Anyway, copy the helper to your
application’s lib/. Then, you can use this:

<%= label ‘Sale Starts On’, :product, :sale_starts_on %>
<%= date_picker_field :product, :sale_starts_on %>

Hope that helps !


#3

On 4/1/06, Francois B. removed_email_address@domain.invalid wrote:

Hi !

You’ll need to copy the helper. This should really be packaged as a
plugin, but it’s not at the moment. Anyway, copy the helper to your
application’s lib/. Then, you can use this:

<%= label ‘Sale Starts On’, :product, :sale_starts_on %>
<%= date_picker_field :product, :sale_starts_on %>

Not work. The interesting is rails does not want to render anything
below date_picker_field line. When I click Choose Date, it just go to
the current page add with # in the end. You mean product is product
table and sale_starts_on is a column of the product table with type
date, right???


#4

Sorry, solve it my self. Forgot to put this in the layout view:
<%= stylesheet_link_tag ‘scaffold’, ‘depot’, ‘admin’, ‘date-picker’,
:media => “all” %>
<%= javascript_include_tag ‘date-picker’ %>


#5

It is very weird. Anything below this line is not rendered:
<%= date_picker_field ‘product’, ‘date_available’ %>

For example this is my code:

Title
<%= text_field 'product', 'title' %>

Date available
<%= date_picker_field 'product', 'date_available' %>

Description
<%= text_area 'product', 'description' %>

Image url
<%= text_field 'product', 'image_url' %>

Product description and product image url do not show up. Any idea?


#6

Hello,

I’m trying to implement a search feature in a project I’m working on.
Here is the gist of it. The project is basically a classified site
which allows people to post a classified ad in a category and specify
the zip code. I would like to let people search classifieds that are
local to them (defined as within 15 miles of their zip). So, would it
be possible to use Ferret to provide searching of the classifieds on
a local basis? Before, with mysql fulltext search I could do a join
between the zip table and the classifieds table, but I found the
results to not be great.

Also, it seems that ferret stores the index file locally. What
happens if I add extra web servers and use load balancing? What
happens to the index in this case?

Thanks,
Carl


#7

If you have more than one machine, you should also consider
http://hyperestraier.sourceforge.net/, which is written in C, but has
ruby-bindings and search is accessible via http and it has a rails
plugin