Can i add attributes to set in create in addition to whateveer's in params
list even if the additional attributes are the only source for attributes
which are validated at the model level For me, headline is validated in the
model but there's no headline field in the form, it gets created on
I'm trying to assign additional parameters to create to satisfy validations
in the model like so
address="params[:address0] + params[:address1]
@user.address=address
if @user.save
...
In this example there's address0 and address1 in the form but not the
schema which has only :address
Should this
On Tuesday, April 25, 2017 at 7:19:25 PM UTC-4, Walter Lee Davis wrote:
>
> Please stick to one thread per question, I've answered this separately.
>
> Walter
>
> > On Apr 25, 2017, at 5:49 PM, fugee ohu
> wrote:
> >
> > I have a hash in my model and need to lookup keys
On Tuesday, April 25, 2017 at 7:18:40 PM UTC-4, Walter Lee Davis wrote:
>
>
> > On Apr 25, 2017, at 8:09 AM, fugee ohu
> wrote:
> >
> > I have a TYPES list in my model for ADDRESS_STATE_TYPES like
> ADDRESS_STATE_TYPES =
> > [ ['Alabama', 'AL'], ...
> > Now in my
On Tuesday, April 25, 2017 at 7:27:25 PM UTC-4, Hassan Schroeder wrote:
>
> On Tue, Apr 25, 2017 at 4:18 PM, Walter Lee Davis > wrote:
>
> > But in an array, you're going to have to iterate to find it:
> >
> > def name_for_code(code)
> > ADDRESS_STATE_TYPES.each do |
On Tue, Apr 25, 2017 at 4:18 PM, Walter Lee Davis wrote:
> But in an array, you're going to have to iterate to find it:
>
> def name_for_code(code)
> ADDRESS_STATE_TYPES.each do | pair |
> return pair.first if pair.last == code
> end
> end
or e.g.
2.3.3 (main):0 >
Please stick to one thread per question, I've answered this separately.
Walter
> On Apr 25, 2017, at 5:49 PM, fugee ohu wrote:
>
> I have a hash in my model and need to lookup keys from values in my
> controller Here's the hash:
> VENUE_STATE_TYPES =
> [
>
> On Apr 25, 2017, at 8:09 AM, fugee ohu wrote:
>
> I have a TYPES list in my model for ADDRESS_STATE_TYPES like
> ADDRESS_STATE_TYPES =
> [ ['Alabama', 'AL'], ...
> Now in my controller i have the value of address_state from the pararms list
> which for the first in
I have a hash in my model and need to lookup keys from values in my
controller Here's the hash:
VENUE_STATE_TYPES =
[
['Alabama', 'AL'],
['Alaska', 'AK'],
...
]
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To
there's a hash in my
--
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-talk+unsubscr...@googlegroups.com.
To post to this group, send email to
YouTube videos of
U.S. Congress money laundering hearing
of
Saudi Billionaire " Maan Al sanea"
with *bank of America*
and The owner of Saad Hospital and Schools
in the Eastern Province in *Saudi Arabia*
and the Chairman of the Board of Directors of Awal Bank in *Bahrain*
On Thursday, April 13, 2017 at 8:22:59 AM UTC-4, Walter Lee Davis wrote:
>
> You _could_ do this, but it's going to be a lot of trouble. Is there a
> reason why you don't want to add a pets table (and Pet model)? Then it
> would simply be a matter of adding a couple lines to your User model,
On Thursday, April 13, 2017 at 8:22:59 AM UTC-4, Walter Lee Davis wrote:
>
> You _could_ do this, but it's going to be a lot of trouble. Is there a
> reason why you don't want to add a pets table (and Pet model)? Then it
> would simply be a matter of adding a couple lines to your User model,
I have a TYPES list in my model for ADDRESS_STATE_TYPES like
ADDRESS_STATE_TYPES =
[ ['Alabama', 'AL'], ...
Now in my controller i have the value of address_state from the pararms
list which for the first in the list would be 'AL' How can I retrieve the
'Alabama' column in my controller if
14 matches
Mail list logo