Render :update do | page | to modify a css class string

In my booking/_form.rhtml, I have 2
startingdate (selction from unobstrusive calendar ) and endingdate

Booking Start Date
<%= text_field_tag('startdate', @startdate, {:class => @startdateclass, :readonly => "readonly", :maxlength => "25"} )%> <%= observe_field("startdate", :frequency => 0.5, :url => {:controller => 'booking' , :action => 'startdateChanged' }, :update => 'enddate', :with => "'input='+$('startdate').value ")%>
Booking End Date
<%= text_field_tag('enddate', @enddate, {:class => @enddateclass, :readonly => "readonly", :maxlength => "25"} ) %>

in my controller when a new startingdate is selected, I modify the
endingdate field value (+10 days) but I should also modify the css
clas that will toggle some dates in the calendar ( a format with
rangelow…) but I don’t know how to modify the css class string of
the ending date
the value is correctly set, not the css class when rendering the

def startdateChanged
pd = ParseDate::parsedate(@params[“input”])
tl = Time.local(pd[0], pd[1], pd[2])
@enddate = (tl+(8460010)).strftime("%d/%m/%Y")
render :update do | page |
page[‘enddate’].value = @enddate
@enddateclass = “format-d-m-y range-low-” + (tl

thanks for your tricks


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