RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: vibhor86
ActiveAdmin.register User do form do |f| f.inputs :email, :password, :password_confirmation f.buttons :commit end end
It worked after I added this in the active admin's resource file - /app/admin/users.rb
The ids will now contain the custom tokens in quote. "author_tokens" parameter will now look like 1,2,'Hello',3,'are','you'
So, you may want to modify the following
def author_tokens=(ids) self.author_ids = ids.split(",") end
Vinicius Depizzol made it possible to create tokens on the fly.
https://github.com/vdepizzol/jquery-tokeninput
Just add allowCustomEntry: true in Application.js
$(function() { $("#book_author_tokens").tokenInput("/authors.json", { crossDomain: false, prePopulate: $("#book_author_tokens").data("pre"), theme: "facebook", allowCustomEntry: true }); });
In case it helps anyone...
To make it work in Rails 2.3, I had to include jQuery before jQuery-Token javascript apart from changing the version specific helpers...
ActiveAdmin.register User do
form do |f|
f.inputs :email, :password, :password_confirmation
f.buttons :commit
end
end
It worked after I added this in the active admin's resource file -
/app/admin/users.rb
The ids will now contain the custom tokens in quote.
"author_tokens" parameter will now look like 1,2,'Hello',3,'are','you'
So, you may want to modify the following
def author_tokens=(ids)
self.author_ids = ids.split(",")
end
Vinicius Depizzol made it possible to create tokens on the fly.
https://github.com/vdepizzol/jquery-tokeninput
Just add allowCustomEntry: true in Application.js
In case it helps anyone...
To make it work in Rails 2.3, I had to include jQuery before jQuery-Token javascript apart from changing the version specific helpers...