Re: [Rails] How to Get Started with Ruby on Rails?

2016-09-30 Thread Walter Lee Davis
> On Sep 30, 2016, at 11:21 AM, Yinka Ash a.k.a Netguru > wrote: > > I would strongly recommend www.tryruby.org to get acquainted with ruby on > rails. > > On Thursday, August 25, 2016 at 12:46:26 PM UTC-4, Faraz Mirza wrote: > Hey Guys! > > I am a Computer Science student. I know basic prog

Re: [Rails] associations - one to many

2016-09-30 Thread Emmanuel Abia
change to this also...observe the category_id attribute. I hope you have it in your product model <%= simple_form_for(@product) do |f| %> <%= f.error_notification %> <%= f.label :category %> <%= f.collection_select :category_id, Category.all, :id, :name %> <%= f.input :title

Re: [Rails] associations - one to many

2016-09-30 Thread Emmanuel Abia
The problem is that you have not passed in the category id so it wont get saved. I suggest you: 1. add category_id to your list of permitted product params 2. introduce validations in the product model to guard against missing values On Fri, Sep 30, 2016 at 4:43 PM, Joe Guerra wrot

[Rails] Lib - Email alert from SQL query

2016-09-30 Thread Yanksan
Folks, A while ago i wrote and used a lib in Ruby for several cases. This lib is an email alert from SQL queries. I put on github https://github.com/edmartins/robotboy, who are interested in taking a look, use, contribute, etc. will be very grateful. Best regards. -- You received this mes

[Rails] Re: How to Get Started with Ruby on Rails?

2016-09-30 Thread Yinka Ash a.k.a Netguru
I would strongly recommend www.tryruby.org to get acquainted with ruby on rails. On Thursday, August 25, 2016 at 12:46:26 PM UTC-4, Faraz Mirza wrote: > > Hey Guys! > > I am a Computer Science student. I know basic programming and > Object-Oriented concepts. I have some experience in web develop

Re: [Rails] associations - one to many

2016-09-30 Thread Joe Guerra
class ProductsController < ApplicationController before_action :set_product, only: [:show, :edit, :update, :destroy] # GET /products # GET /products.json def index # @search = Product.search(params[:search]) #ransack @search = Product.search(params[:q]) @products

Re: [Rails] associations - one to many

2016-09-30 Thread Emmanuel Abia
Pardon me its the update action code On 30 Sep 2016 4:31 p.m., "Emmanuel Abia" wrote: > Need the code in the controller edit action > > On 30 Sep 2016 4:03 p.m., "Joe Guerra" wrote: > >> Ok, here is my edit products page... >> >> <% if user_signed_in? %> >> >> Editing Product >> >> <%= render

Re: [Rails] associations - one to many

2016-09-30 Thread Emmanuel Abia
Need the code in the controller edit action On 30 Sep 2016 4:03 p.m., "Joe Guerra" wrote: > Ok, here is my edit products page... > > <% if user_signed_in? %> > > Editing Product > > <%= render 'form' %> > > <%= link_to 'Show', @product %> | > <%= link_to 'Back', products_path %> > > <% else %>

Re: [Rails] associations - one to many

2016-09-30 Thread Colin Law
On 30 September 2016 at 16:03, Joe Guerra wrote: > Ok, here is my edit products page... And, more importantly, the update method in the controller, which is probably what Emmanuel meant as that is where you should be saving the data after all. Also copy/paste here what you see in the log when yo

[Rails] Re: How to Get Started with Ruby on Rails?

2016-09-30 Thread Joe Guerra
The easiest way is to sign up for a free account on c9.io. You get 2 workspaces and everything is configured for you to start working on ruby on rails projects. (and you can access it anywhere.) Try some free udemy rails courses. On Thursday, August 25, 2016 at 12:46:26 PM UTC-4, Faraz Mirza wr

Re: [Rails] associations - one to many

2016-09-30 Thread Joe Guerra
Ok, here is my edit products page... <% if user_signed_in? %> Editing Product <%= render 'form' %> <%= link_to 'Show', @product %> | <%= link_to 'Back', products_path %> <% else %> You must be signed in as administrator to edit the products. <% end %> here is my _form <%= simpl

Re: [Rails] associations - one to many

2016-09-30 Thread Emmanuel Abia
You need to show the code for your edit On 30 Sep 2016 3:51 p.m., "Joe Guerra" wrote: > I've got two tables in my Postgres database: categories and products. > > I have a one to many relationship defined, one category can have many > products. > > > I then created a reference and migrated the ta

[Rails] associations - one to many

2016-09-30 Thread Joe Guerra
I've got two tables in my Postgres database: categories and products. I have a one to many relationship defined, one category can have many products. I then created a reference and migrated the tables. AddCategoryRefToProducts category:references I have this in my models. #product.rb belo

[Rails] [HOT JOB] Full Stack Developer for Berlin based start up company

2016-09-30 Thread inna . skochko
Welcome to Movinga! We are a young and dynamic company, founded with the ambition to disrupt the moving industry, in Europe and globally. From the simple online booking process to the consistently high service quality: this is what moving in the 21st century looks like. Backed by renowned inv