Hi
if I have this on one html.erb page
<%= text_field("cars_", "name", :size => "30") %>
and
def find
@car = Car.new(params[:car_])
carsearch = @car.name
....
why is the carsearch coming as nil?
Hi
if I have this on one html.erb page
<%= text_field("cars_", "name", :size => "30") %>
and
def find
@car = Car.new(params[:car_])
carsearch = @car.name
....
why is the carsearch coming as nil?
Maybe because the field is cars_
(plural) and the find is using car_
(singular)?
If you are trying to use carsearch
on an erb template, then you need to make it an attribute instead of a variable, it should be @carsearch
.