[Rails] create action

2017-04-25 Thread fugee ohu
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

[Rails] additional params in controller create action

2017-04-25 Thread fugee ohu
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

Re: [Rails] use hash from model in controller

2017-04-25 Thread fugee ohu
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

Re: [Rails] accessing key/value pairs in views from model TYPES list

2017-04-25 Thread fugee ohu
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

Re: [Rails] accessing key/value pairs in views from model TYPES list

2017-04-25 Thread fugee ohu
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 |

Re: [Rails] accessing key/value pairs in views from model TYPES list

2017-04-25 Thread Hassan Schroeder
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 >

Re: [Rails] use hash from model in controller

2017-04-25 Thread Walter Lee Davis
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 = > [ >

Re: [Rails] accessing key/value pairs in views from model TYPES list

2017-04-25 Thread Walter Lee Davis
> 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

[Rails] use hash from model in controller

2017-04-25 Thread fugee ohu
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

[Rails] using a hash from model in controller

2017-04-25 Thread fugee ohu
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

[Rails] Fwd: Us congress hearing of maan alsaan Money laundry قضية الكونغجرس لغسيل الأموال للمليادير معن الصانع

2017-04-25 Thread Sami A
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*

Re: [Rails] How do I create a form that allows users to add additional instances of the same field if needed

2017-04-25 Thread fugee ohu
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,

Re: [Rails] How do I create a form that allows users to add additional instances of the same field if needed

2017-04-25 Thread fugee ohu
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,

[Rails] accessing key/value pairs in views from model TYPES list

2017-04-25 Thread fugee ohu
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