[Rails] Re: Proper Coding Question

2018-10-03 Thread John Sanderbeck
Excellent... So it's OK to call policy_scope(User) from a view? That's what I was confused by... On Wednesday, October 3, 2018 at 12:44:52 PM UTC-4, Eric Anderson wrote: > > There is an `collection_select` form builder that will do the `collect` > for you. So: > > <%= f.collection_select

Re: [Rails] country select gem

2018-10-03 Thread Rob Zolkos
<%= f.select :country, options_for_select(["CA", "US"]) %> On Thu, Oct 4, 2018 at 6:40 AM Joe Guerra 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) > >

[Rails] country select gem

2018-10-03 Thread 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:

[Rails] Re: Proper Coding Question

2018-10-03 Thread Eric Anderson
There is an `collection_select` form builder that will do the `collect` for you. So: <%= f.collection_select :user, policy_scope(User), :id, :name %> If you are not using a form builder then `options_from_collection_for_select` is useful for the same purpose. If those helpers cannot be

[Rails] Announcing RubyHACK 2019

2018-10-03 Thread Allen Maxwell
CFP and registration is open for the next event. Also looking for sponsors! https://rubyhack.com for details. Max -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop