[Rails] PG::ConnectionBad: could not connect to server: No such file or directory

2014-10-15 Thread bradford li
I posted a question on stackoverflow seeking help. I;ve been asking on the ruby on rails IRC channel as well. I'm not sure how to fix this issue. I am new to ruby on rails and I having a hard time getting postgres to work with my rails app. When I run rake db:create or rake db:migrate, I get

Re: [Rails] PG::ConnectionBad: could not connect to server: No such file or directory

2014-10-15 Thread Colin Law
On 15 October 2014 08:46, bradford li bradfor...@gmail.com wrote: I posted a question on stackoverflow seeking help. I;ve been asking on the ruby on rails IRC channel as well. I'm not sure how to fix this issue. I am new to ruby on rails and I having a hard time getting postgres to work with

[Rails] Re: PG::ConnectionBad: could not connect to server: No such file or directory

2014-10-15 Thread bradford li
Here is my database.yml # PostgreSQL. Versions 8.2 and up are supported. # # Install the pg driver: # gem install pg # On OS X with Homebrew: # gem install pg -- --with-pg-config=/usr/local/bin/pg_config # On OS X with MacPorts: # gem install pg --

Re: [Rails] Re: PG::ConnectionBad: could not connect to server: No such file or directory

2014-10-15 Thread Colin Law
On 15 October 2014 09:00, bradford li bradfor...@gmail.com wrote: Here is my database.yml # PostgreSQL. Versions 8.2 and up are supported. # # Install the pg driver: # gem install pg # On OS X with Homebrew: # gem install pg -- --with-pg-config=/usr/local/bin/pg_config # On OS X with

[Rails] Re: Can't connect to localhost:3000

2014-10-15 Thread grzegorz
Hi Mike, Maybe the resolver is the issue? Can you connect to 127.0.0.1:3000? You can also check where the process is binding. On Linux that would be `netstat -ntlp` - look for you Rails app there. That may work on a Mac but I'm not sure. Best regards -- Greg On Wednesday, October 15, 2014

[Rails] Re: Can't connect to localhost:3000

2014-10-15 Thread jsnark
On *nix systems, the file /etc/hosts contains the mapping from localhost to 127.0.0.1. It should contain a line like: 127.0.0.1 localhost.localdomain localhost I do not know whether or not Mac uses the same file. On Tuesday, October 14, 2014 10:05:13 PM UTC-4,

Re: [Rails] One huge table or separate tables? design issue

2014-10-15 Thread Yongbiao Long
I feel sorry to bother you all again here, but I still have a problem: How to deal with the daily created tables in rails? I googled around and found nothing. The daily created tables are named on the dates, their names are all different. I know how to create tables in a periodically executed

Re: [Rails] One huge table or separate tables? design issue

2014-10-15 Thread Scott Ribe
On Oct 15, 2014, at 8:44 AM, Yongbiao Long longyongb...@gmail.com wrote: How to deal with the daily created tables in rails? Don't do that. It's an unnormalized, broken, bordering-on-insane design. The date is an attribute of some entity that belongs in its own table, to which your other data

Re: [Rails] One huge table or separate tables? design issue

2014-10-15 Thread Colin Law
On 15 October 2014 15:44, Yongbiao Long longyongb...@gmail.com wrote: I feel sorry to bother you all again here, but I still have a problem: How to deal with the daily created tables in rails? I googled around and found nothing. The daily created tables are named on the dates, their names are

[Rails] Rails 4 testing- RSPEC + Capybara + current_user

2014-10-15 Thread Sean Kelley
I am having a problem writing one of my first tests. I am using capybara to test an add form. A select on the form is populated from existing db records associated records of the current_user defined in controller. I posted my problem originally on stack overflow but have not had any

[Rails] Problema con variable en ruby on rails

2014-10-15 Thread Esteban Penagos
Buenos Días, estoy haciendo una aplicación de pedidos en linea en Ruby On Rails y tengo un problema que no e podido solucionar Mi problema son el manejo de las variables en rails. uno de los inconvenientes es que tengo un (select_tag) que lista los descuentos (0, 10, 15) que se le otorgara al

[Rails] before_update callback is called when new record is created

2014-10-15 Thread Brian Sammon
All my tables/models have a revision field, and I have a before_update callback to increment the revision field. Among my tables are: events rooms events_rooms In my Event model, I have: has_many :eventRooms has_many(:rooms, :through = :eventRooms) When I create an event, assign a

Re: [Rails] Problema con variable en ruby on rails

2014-10-15 Thread Colin Law
2014-10-15 21:56 GMT+01:00 Esteban Penagos li...@ruby-forum.com: Buenos Días, estoy haciendo una aplicación de pedidos en linea en Ruby On Rails y tengo un problema que no e podido solucionar Mi problema son el manejo de las variables en rails. uno de los inconvenientes es que tengo un

[Rails] Re: Problema con variable en ruby on rails

2014-10-15 Thread Esteban Penagos
hi colin my problem is: I need to capture the value of % = select_tag list, options_for_select ([0, 10, 15], 0)% in a variable, to calculate the value of the product conclucion the user chooses in the 0 or 10 or 15 and I need to capture that number as a variable thank you very much -- Posted

[Rails] Rendering 'update' form partial using AJAX

2014-10-15 Thread David Maxwell
I have a page where I do this: div id=submitForm % if current_user.already_done?(@question) % %= render 'update_info_form' % % else % %= render 'create_info_form' % % end % /div Which works fine. It checks if the user has already answered a question, and picks either the