country select gem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

country select gem

Joe Guerra
I'm not sure why I went to this extent, but I was trying to remove the gem and failed.  (it still kept finding the helper method - even though I removed it from my view)

Anyways,  I'm got this code...  but it doesn't like the label;

<%= f.country_select :country, only: ["CA", "US"], label: 'Country', required: true %>

Maybe there's a better way to do this with simple forms, I just need 2 values in the drop down.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: country select gem

Rob Zolkos-2
<%= f.select :country, options_for_select(["CA", "US"]) %>

On Thu, Oct 4, 2018 at 6:40 AM Joe Guerra <[hidden email]> wrote:
I'm not sure why I went to this extent, but I was trying to remove the gem and failed.  (it still kept finding the helper method - even though I removed it from my view)

Anyways,  I'm got this code...  but it doesn't like the label;

<%= f.country_select :country, only: ["CA", "US"], label: 'Country', required: true %>

Maybe there's a better way to do this with simple forms, I just need 2 values in the drop down.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ6MPzJn7Qr8%3DjxSdDhz8UzX0gmcrCpQZrFmODz_qSSSHBAOWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: country select gem

fugee ohu


On Wednesday, October 3, 2018 at 6:56:37 PM UTC-4, Rob Zolkos wrote:
<%= f.select :country, options_for_select(["CA", "US"]) %>

On Thu, Oct 4, 2018 at 6:40 AM Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="p-F-26MjAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
I'm not sure why I went to this extent, but I was trying to remove the gem and failed.  (it still kept finding the helper method - even though I removed it from my view)

Anyways,  I'm got this code...  but it doesn't like the label;

<%= f.country_select :country, only: ["CA", "US"], label: 'Country', required: true %>

Maybe there's a better way to do this with simple forms, I just need 2 values in the drop down.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="p-F-26MjAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="p-F-26MjAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

Why don't you get it working first by putting the label on the preceeding line in it's own containers and putting the validation in your model, then you can try to get yo?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b98c34cb-fe03-4ace-a049-3791f3be39b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: country select gem

fugee ohu
In reply to this post by Rob Zolkos-2


On Wednesday, October 3, 2018 at 6:56:37 PM UTC-4, Rob Zolkos wrote:
<%= f.select :country, options_for_select(["CA", "US"]) %>

On Thu, Oct 4, 2018 at 6:40 AM Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="p-F-26MjAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
I'm not sure why I went to this extent, but I was trying to remove the gem and failed.  (it still kept finding the helper method - even though I removed it from my view)

Anyways,  I'm got this code...  but it doesn't like the label;

<%= f.country_select :country, only: ["CA", "US"], label: 'Country', required: true %>

Maybe there's a better way to do this with simple forms, I just need 2 values in the drop down.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="p-F-26MjAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="p-F-26MjAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

 Why don't you put the label on the previous line and the validation in the model? 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e12e1811-7b79-45bd-a630-bf0e6272f438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: country select gem

Joe Guerra
I used this instead...

    <%= f.input :country, :collection => %w[Canada USA], required: true %>



On Saturday, October 6, 2018 at 2:22:26 AM UTC-4, fugee ohu wrote:


On Wednesday, October 3, 2018 at 6:56:37 PM UTC-4, Rob Zolkos wrote:
<%= f.select :country, options_for_select(["CA", "US"]) %>

On Thu, Oct 4, 2018 at 6:40 AM Joe Guerra <[hidden email]> wrote:
I'm not sure why I went to this extent, but I was trying to remove the gem and failed.  (it still kept finding the helper method - even though I removed it from my view)

Anyways,  I'm got this code...  but it doesn't like the label;

<%= f.country_select :country, only: ["CA", "US"], label: 'Country', required: true %>

Maybe there's a better way to do this with simple forms, I just need 2 values in the drop down.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/704a3b5c-9218-4a8e-a32a-0d919d089e2b%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

 Why don't you put the label on the previous line and the validation in the model? 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/97d1fa43-11e5-44c3-b323-bee88896eb17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.