non active record models #1
Description
Hi,
I'm trying to use this helper with a non active record model. here is the model code without application logic:
class Source < Foodtree::API::Base
include ActiveModel::Validations
include ActiveModel::Validations::Callbacks
include ActiveModel::Conversion
extend ActiveModel::Naming
def initialize(attributes = {})
attributes.each do |name, value|
send("#{name}=", value)
end
end
def persisted?
false
end
needed by the jquery_autocomplete_helper plugin
def display_name
name
end
end
in my views I have used the helper as you instructed:
<%= f.autocomplete_field(:source_id, :url => sources_path)%>
and when loading the page I get the following error on the same line in the view as above:
undefined method `pluralize' for nil:NilClass
What do I need to do so the helper works with non active record models?