[Rails] Re: Re: Re: Iterate over a collection/association model

2016-04-12 Thread David Williams
Colin Law wrote in post #1182808: > On 12 April 2016 at 19:10, David Williams wrote: undefined method `state_id' for # > > What has the categories table got to do with it? I thought this > problem is about profiles and states. > > Colin I made a small mistake, I've

Re: [Rails] Re: Re: Iterate over a collection/association model

2016-04-12 Thread Colin Law
On 12 April 2016 at 19:10, David Williams wrote: > Colin Law wrote in post #1182803: >> On 12 Apr 2016 6:58 p.m., "David Williams" wrote: >>> >>> shahroon ali wrote in post #1182801: >>> > belongs_to :states should be :state singular. >>> > >>> > On

[Rails] Re: Iterate over a collection/save associated model

2016-04-12 Thread David Williams
I fixed it, thanks guys. The state_id was missing on the profile table. -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] I am loking for low paid job with mentor as Junior developer.

2016-04-12 Thread Boris Strelnikov
Hello everybody! I am from Russia, my real name is Boris. I have small eperience with Ruby on Rails - 1 year. With my friend we have developed site studpad.ru (https://github.com/studpad/studpad), using React and Ruby on Rails. Also I have moonlightinged in company for 7 monthes and worked with

[Rails] Re: Re: Iterate over a collection/association model

2016-04-12 Thread David Williams
Colin Law wrote in post #1182803: > On 12 Apr 2016 6:58 p.m., "David Williams" wrote: >> >> shahroon ali wrote in post #1182801: >> > belongs_to :states should be :state singular. >> > >> > On Tue, Apr 12, 2016 at 10:47 PM, David Williams >> >> I fixed

Re: [Rails] Re: Iterate over a collection/association model

2016-04-12 Thread Colin Law
On 12 Apr 2016 6:58 p.m., "David Williams" wrote: > > shahroon ali wrote in post #1182801: > > belongs_to :states should be :state singular. > > > > On Tue, Apr 12, 2016 at 10:47 PM, David Williams > > I fixed the typo, but it's still not working. > >

[Rails] Re: Iterate over a collection/association model

2016-04-12 Thread David Williams
shahroon ali wrote in post #1182801: > belongs_to :states should be :state singular. > > On Tue, Apr 12, 2016 at 10:47 PM, David Williams I fixed the typo, but it's still not working. undefined method `state_id' for # -- Posted via http://www.ruby-forum.com/. -- You

Re: [Rails] Iterate over a collection/association model

2016-04-12 Thread shahroon ali
belongs_to :states should be :state singular. On Tue, Apr 12, 2016 at 10:47 PM, David Williams wrote: > I have a profile model that has a user state model (emotional state) - > What I would like to do is give the user object the ability to change > their state through the

[Rails] Iterate over a collection/association model

2016-04-12 Thread David Williams
I have a profile model that has a user state model (emotional state) - What I would like to do is give the user object the ability to change their state through the profile model. The code that I've written is below. I'm receiving "NoMethodError - undefined method 'state_id' for #" even though,

[Rails] Re: can i use OR and also AND in the same where clause?

2016-04-12 Thread jim
I like to use a dash of Arel for this (took a guess at the friendables association class name, adjust as necessary): current_user.profile.friendables.where(Friendable.arel_table[:from_id].eq( current_user.id).or(Friendable.arel_table[:to_id].eq(current_user.id))). where(accepted: true) A bonus

[Rails] Survey: 2016 Rails hosting community survey

2016-04-12 Thread 'Robby Russell' via Ruby on Rails: Talk
Hi everyone! Hope you're having an awesome day. As you might have seen DHH tweeted recently , the 2016 Ruby on Rails Hosting survey is now open until May 8th. Background: In 2009, we invited the community to

Re: [Rails] Re: Re: Find All records with associated records

2016-04-12 Thread Colin Law
On 12 April 2016 at 14:43, Naveed Alam wrote: > Colin Law wrote in post #1182787: >> On 12 April 2016 at 08:52, Naveed Alam wrote: As a beginner I suggest you work right through a good tutorial in order to get the basics or Rails. The one I

[Rails] Re: Re: Find All records with associated records

2016-04-12 Thread Naveed Alam
Colin Law wrote in post #1182787: > On 12 April 2016 at 08:52, Naveed Alam wrote: >>> As a beginner I suggest you work right through a good tutorial in >>> order to get the basics or Rails. The one I suggest is >>> railstutorial.org (which is free to use online). >>> >>>

[Rails] Re: How to manage data in MongoDB

2016-04-12 Thread John Smith
Data management tool in MongoDB; AdminMongo Edda Fluented HumongouS.io Here is the link for more information about mongodb: https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/ -- Posted via http://www.ruby-forum.com/. -- You received this message because you

Re: [Rails] Re: Find All records with associated records

2016-04-12 Thread Colin Law
On 12 April 2016 at 08:52, Naveed Alam wrote: >> As a beginner I suggest you work right through a good tutorial in >> order to get the basics or Rails. The one I suggest is >> railstutorial.org (which is free to use online). >> >> Colin > > Thanks colin I already tried this

[Rails] Re: Find All records with associated records

2016-04-12 Thread Naveed Alam
> As a beginner I suggest you work right through a good tutorial in > order to get the basics or Rails. The one I suggest is > railstutorial.org (which is free to use online). > > Colin Thanks colin I already tried this but it give me the error: undefined method `company_name' for nil:NilClass

Re: [Rails] Find All records with associated records

2016-04-12 Thread Colin Law
On 12 April 2016 at 08:17, Naveed Alam wrote: > Hi, > > Using rails 4, I have two models Supplier and Category > > Category belongs_to Supplier > > and Supplier has_many categories > > > now the suppliers table has fields, company_name, address, phone etc. > and id > > and

[Rails] Find All records with associated records

2016-04-12 Thread Naveed Alam
Hi, Using rails 4, I have two models Supplier and Category Category belongs_to Supplier and Supplier has_many categories now the suppliers table has fields, company_name, address, phone etc. and id and the categories has cat_name and supplier_id in the categories index view I want to