Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Taylor Quinn
Taylor Quinn
20,003 Points

Rails Associations and input

I am trying to display user's names with their service and retail sales numbers for a given data range while also creating a form to input all sales for users. I am using devise and simple form and rails 4. So far I have been able to to display users in a list but have not been to create inputs. I have created two tables one called users and another called sales with columns of id, service_sales, retail_sales, and user_id. I am not sure where to go from here, this is what I have on github:

https://github.com/tjquinn1/znasty

Any help is greatly appericate

Let me have a look - my Rails is a little rusty but I'll have a go!

What is not working as you expect and what did you expect it to do/what did it do?

I can't get mysql to work - it's asking for secret keys and bases ... argh!

Taylor Quinn
Taylor Quinn
20,003 Points

As far as the secrets and bases did you generate yml file enter in your mysql info then run rake db:create? Maybe you can help without actually running the code, what I am trying to do is to is create a form to list all the employee with two inputs for their sales number by an admin. So far I have created an association of sales belong_to user(employee) and user has_many sales. I guess where I am getting stuck is that I have created two tables one for users and one for sales and I can not seem to get them to link together. Any ideas?

No, I didn't generate a yml file in a Rails/rake perspective; should I have? I've added a secrets.yml file and a database.yml file but that's all.

Sorry, I am rusty on Rails at the moment. A few months ago, I'd have answered that without needing the application live to see it. If you have any setup tips (mine is "use sqlite3") for mysql, let me know.

Steve.