Comments (14)
@kakubei you simply need to pass the new type:
= country_form.input :country :as => :select
It is documented and there is a huge table in the README.
from simple_form.
As per my understanding after reading your question, you should get countries list from table in a variable then use that variable in select_tag instead of using simple_form
from simple_form.
@kakubei you can specify string input with :as => :string
from simple_form.
You need to install country_select as plugin in order for it to work. I believe an error should have been raised.
from simple_form.
will be nice to have this on documentation at installation section, will help others to don't fall in this problem :)
from simple_form.
Please update the docs and send me a pull request then!
from simple_form.
Hi I tried both plugin and gem f country select but all in vain. Getting error when installed
ActionView::Template::Error (undefined method `country_select' for #ActionView::Helpers::FormBuilder:0x7fd7eaa1ad78):
can any one help and provide its Doc in help file about its useage :) thanks in advance
from simple_form.
Friends I've found the answer of the question. I posted above. I did not restart the server after installing plugin. :) hurrra
from simple_form.
I get the same error, but I'm not using the plugin, nor do I wan to use it, I simply want to grab all the countries from within a table I already have. This error is coming up because presumably simple_form
is getting confused by the :country
symbol and wants to call the plugin. I simply want to list what I've retrieved from my own countries table with a column called 'country'.
Surely there is a workaround for this?
from simple_form.
@taimoor018 Why would I need to do that, when all my other forms work? Is there no other workaround? Also, I get the same error using neste fields:
= simple_form_for @DVD do |f|
= f.simple_fields_for :dvd_country do |country_form|
= country_form.input :country
from simple_form.
@josevalim Thanks Jose, I didn't actually see that in the readme. What I want is a text field, so I'll use :as => text
. Let me ask you, speaking of text, is there a way to specify a text input as opposed to textarea?
Again, I didn't see any option for that in the readme (just text which creates a textarea).
By the way, thanks for this wonderful gem it is truly fantastic. Muito obrigado.
from simple_form.
@nashby thanks so much, how dumb of me! :P
from simple_form.
Am I right to think that,
with the following :
= f.input :shipping_country, label: "blah blah", :wrapper_html => {:class => "field half right"}
and getting the following error :
undefined method `country_select' for #<SimpleForm::FormBuilder:0x007f87f3779f98>
your plugin is a little bit too strict on the transformation of the word "country" ?
from simple_form.
@bbnnt it assumes a default which most people would use, which is the country select plugin, but it is flexible enough by allowing you to easily configure it to be different, completely ignoring country select. Check #757 for more info.
from simple_form.
Related Issues (20)
- Changelog entry needed for 5.2.0 HOT 3
- Is there any particular reason for the use of `%%` instead of `%` in the ERB template? HOT 2
- @builder.input_field(:license_plate, type: 'radio' .... ) output a textarea tag instead of an inpt HOT 1
- Broken Link in Readme File for Bootstrap Live App example HOT 4
- Chrome error: label's for attribute doesn't match any element id
- Bootstrap floating labels keep floating even without input HOT 1
- Auto reload configuration HOT 3
- `config.default_form_class` should not be *overriden* but *complemented* when `html: { :class }` is specified HOT 1
- Redundant aria-required on required fields HOT 1
- 5.3.0 - Custom Inputs Fail to Load HOT 3
- Rails 7.1 updated password validation changed rendering of password inputs
- Custom Component raise an error with rails 7.1 and zeitwerk HOT 1
- Hints don't work on the namespaced model HOT 1
- Encrypted attributes always default to textarea
- Proposal for customizable classes merging
- The custom `error:` on all inputs does not work if there is an object present
- Multiple inputs with the same name generate unparseable names in Rails >= 7.1.1
- <div class="checkbox"> <input value="false" type="hidden" name="meal[completed]"> <input class="boolean optional" type="checkbox" value="true" checked="checked" name="meal[completed]" id="meal_completed"> <label class="boolean optional" for="meal_completed">Completed</label> </div>Update: This bug only appears if you have custom value for `unchecked_value`. In this case `unchecked_value: false` HOT 1
- https://simple-form-bootstrap.herokuapp.com/ is Down HOT 1
- Label's for attribute doesn't match the id when nil is given in collection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple_form.