Metal
Metal

Reputation: 205

Passing a previous date in link

I want to create a link name as Previous date and Next date in my show action. Please suggest me that how should I pass the date in that . i.e. If one clicks on the previous link then the records are displayed of the previous day and vice versa.

How to pass the date in show action? Please guide.

P.S. :- I am using rails 3

Upvotes: 0

Views: 114

Answers (1)

Vik
Vik

Reputation: 5961

To display date and pass as link parameter you can use either ruby code or jQuery .

Ruby : To get the date : How to calculate next, previous business day in Rails?

Put such function in your application helper . And call into you view and also pass as link parameter .

jQuery :

Error creating a '< previous' and 'next >' (date) link for jQueryUI datepicker using setdate

Upvotes: 1

Related Questions