You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
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:
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?
The text was updated successfully, but these errors were encountered: