text_field com Where to search in Rails

Asked

Viewed 40 times

1

I’m starting to study Rails and am trying to search by name and date on a list.

I would like to present on the screen inside the show page this search by name and date

where I am trying to create the form in the view

<form>
<%= text_field(@fees_by_name , "") %>
<%= select_date(@my_date, start_year: Date.today.year - 100, end_year: Date.today.year + 5, order: [:month, :year]) %>
<%= button_to 'Search' %>
</form>

def in Controller to get global variables

def show
@my_date = params[:date].nil? ? Date.today : DateTime.new(params[:date][:year].to_i, params[:date][:month].to_i)
@fees = @condominium.fees
end
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.