i have a rails project that has a simple mapped relation like below:
model categories
has_many :stories
model Story
belongs_to category
in my stories controller i have
def new
@story = Story.new
@categories = Category.all
end
then in my new.html.erb i have
<%= form_for @story do |f| %>
<%= f.text_field, :title %>
<%= collection_select(:story, :category_id, @categories, :id, :name)%>
<% end %>
i want to replace the <%= collection_select %>
(select box) with <%= f.text_field%>
(text field) and populate the data using jquery toxeninput javascript plugin and i dont know how to go about this.