Hi,
I am trying to add onchange handler to see which select option is currently selected and put it in a file. How can I do this?
<select id="subtable" name="subtable" size="20" style="width: 400px">
<%= options_from_collection_for_select(@hauses, 'id', 'timebuild', @hauses.first.id), {}, {:onchange => catch()} ) %>
</select>
where the controller is this
def index
@hauses = Hauses.find(:all)
end
def catch
@hs = Hauses.find(params[:hauses_id])
file = File.new("catch.txt","ab")
file.puts(@hs)
file.close
end
It shows error of undefined method `catch'
Thank you for any guidance