Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

non active record models #1

Open
mkhezr opened this issue Aug 22, 2011 · 1 comment
Open

non active record models #1

mkhezr opened this issue Aug 22, 2011 · 1 comment

Comments

@mkhezr
Copy link

mkhezr commented Aug 22, 2011

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?

@dgm
Copy link
Owner

dgm commented Sep 2, 2011

I really don't know off the top of my head what it would take...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants