Hi, I have Holiday table. the fileds are id,holiday_date,description. i
added new records and list them also. when i listed all the records in
the database are listed but i want to list only one particular year
records. my holiday_list.rhtml page is as follows
<%= stylesheet_link_tag “common”, :media => “all” %>
<%= error_messages_for ‘holiday’ %>
<%= form_tag(:controller => “admin”, :action => “holiday_list”) %>
<%= link_to 'Add holiday', :action => 'holiday_edit' %> |
List of Holidays
<%
if @holidays.length > 0
%>
<%
d=select_year(2006,:prefix => “year”,:discard_type => true)
%>
<%=d%><%= submit_tag("Ok", :id => 'form-submit-button') %>
Date | Description | Actions |
---|---|---|
<%= h(holiday.holiday_date) %> | <%= h(holiday.description) %> | <%= link_to 'Show', :action => 'holiday_show', :id => holiday %> <%= link_to 'Edit', :action => 'holiday_edit', :id => holiday %> <%= link_to 'Destroy', { :action => 'holiday_destroy', :id => holiday }, :confirm => "Are you sure to delete holiday '#{holiday.description}'?" %> |
<% end %>
<%= link_to 'Add holidays', :action => 'holiday_edit' %> |
in admn_controller.rb file inclues
def holiday_list
@holiday_pages, @holidays = paginate :holidays
end
it displays all the records.
can anybody mail how to display only particular year records.
if u have any idea about this kindly mail me [email protected]
thanks
regards
Nithya