Open tbjers opened 9 years ago
I solved this by adding the following custom input class:
class InetInput < Formtastic::Inputs::StringInput
end
I put this file in app/inputs/inet_input.rb
and it works fine with existing users as well as new users. You may still want to auto-generate this file for when user's build their project with PostgreSQL, ActiveAdmin and Formtastic so that the page doesn't crash.
Rails 4.1.1, PG, devise and activeadmin, exactly same issue here when either editing existing user or creating new one.
@tbjers solution worked for me
@tbjers Thank you very much that worked for me too
@tbjers Worked as well, thank you
@tbjers Thanks for the fix. I will have Prelang inject that file.
@eriknomitch No problem. Glad I could be of assistance!
Thank you very much @tbjers , that worked out for me as well.
Thank you very much @tbjers , that worked out for me as well
Reopening since I haven't had time to implement the fix. See this disclaimer as to why.
Hi, all.
This helped me too.
But there is similar error "Unable to find input class HstoreInput".
Fixed it in the similar way - added file /app/inputs/hstore_input.rb
class HstoreInput < Formtastic::Inputs::TextInput
end
worked for me too! thanks
Appreciate the fix, Torgny. Extremely helpful!
Perfect solution +1 Thanks
Yea this worked for me! Awesome!!
Please consider adding this solution https://github.com/Prelang/feedback/issues/14#issuecomment-63241267 by default in the gem.
Great idea !!!
I like it ... saved me 3 days of pain :)
thanks @tbjers, you've fixed my day :)
@tbjers +1 in 2016 for this that solves money-rails gem! Thanks!
Hi guys,
On the same tune...again.
I was having dependency issues with
# gem 'active_admin_editor', github: 'ejholmes/active_admin_editor'
.
and getting the error "Unable to find input class HtmlEditorInput"
Fixed it in the similar way - added the file /app/inputs/html_editor_input.rb
class HtmlEditorInput < Formtastic::Inputs::TextInput end
@tbjers Thanks for the solution, nice idea! In my opinion, even more elegant solution is moving the file into the lib directory. In my case, for jsonb, it is:
_/lib/ext/jsonbinput.rb
class JsonbInput < Formtastic::Inputs::StringInput
end
_/initializers/loadextensions.rb
Dir["#{Rails.root}/lib/ext/**/*"].each { |f| require f }
Of course it also works.
I have the same issue but I can't use this solution because I dont have an app/inputs/ folder or app/active_admin/inputs/ directory to create the input.rb file! I can't find the folder nowhere! My directory looks like this: app/admin/
Has someone any idea how I can get around this issue?
My workspace is the cloud9 IDE and I am using rails 5.0.0.1 and my Gemfile looks like this:
gem 'devise'
gem 'activeadmin', github: 'activeadmin/activeadmin'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
Thanks in advance!
@martinbortowski The inputs isn't a standard folder. Just create it.
@konradrr Thank you so much it worked! I thought that it was a standard folder!
Hi, the solution did not work for me. I have the error message:
@input_class_finder.find(as) rescue Formtastic::InputClassFinder::NotFoundError raise Formtastic::UnknownInputError, "Unable to find input #{$!.message}" end
# @api private
Do I need to do something else?
Hi, all. This helped me too. But there is similar error "Unable to find input class JsonInput". Fixed it in the similar way - added file /app/inputs/json_input.rb class HstoreInput < Formtastic::Inputs::TextInput end
if you have an error as same as
ActionView::Template::Error (Unable to find input class JsonInput)
Then this helped me
app/inputs/json_input.rb
class JsonInput < Formtastic::Inputs::TextInput; end
@tbjers Thank you very much that worked for me
Thanks, it still working on Rails 5.
@tbjers it worked. Thanks a lot
I just generated an application using ActiveAdmin, Devise, Formtastic, and PostgreSQL. Everything generated just fine and I fired up the application. Once I had the application running, I went to the admin interface and poked around. When I tried to create a new User, I got the following error:
The two fields
current_sign_in_ip
andlast_sign_in_ip
are both created with theinet
type in PostgreSQL. Would it be helpful for people with similar configurations if you added a custom input class for theinet
field type, or simply ignore those two fields in the form?