Re: [Rails] RSpec vs. Cucumber

2013-08-22 Thread Emil S
My rule of thumb : Cucumber for integration testing ( output = documentation of features ) and RSpec for unit testing ( output = documentation of code ) On 23 August 2013 03:18, Tamara Temple wrote: > > On Aug 22, 2013, at 4:29 PM, "Jason Hsu, Android developer" < > jhsu802...@gmail.com> wrote:

Re: [Rails] Images with fingerprinting

2013-08-22 Thread Nick Khamis
Tamouse, I really appreciate this, and apologize for the partial code... `wine` is the parameter of a render function: function renderDetails(wine) { $('#wineId').val(wine.id); $('#name').val(wine.name); $('#grapes').val(wine.grapes); $('#country').val(wine.country); $('#region').val(wine.regi

Re: [Rails] Images with fingerprinting

2013-08-22 Thread Tamara Temple
On Aug 22, 2013, at 4:15 PM, Nick Khamis wrote: > Hello Tamouse, > > Thank you so much for your reply, > > Where trying $('#pic').attr('src', "<%= asset_path(wine.picture)%>");, I get > the following error: > > undefined local variable or method `wine' for > #<#:0x4311bb04> > > I hope I di

Re: [Rails] RSpec vs. Cucumber

2013-08-22 Thread Tamara Temple
On Aug 22, 2013, at 4:29 PM, "Jason Hsu, Android developer" wrote: > So far, I've been using RSpec for testing my Rails apps simply because that's > what railstutorial.org emphasizes. > > However, I am in the process of trying out Cucumber. I like the fact that > it's in plain English, and

[Rails] RSpec vs. Cucumber

2013-08-22 Thread Jason Hsu, Android developer
So far, I've been using RSpec for testing my Rails apps simply because that's what railstutorial.org emphasizes. However, I am in the process of trying out Cucumber. I like the fact that it's in plain English, and this is an asset for communicating with clients or other people who aren't Rubyi

Re: [Rails] Images with fingerprinting

2013-08-22 Thread Nick Khamis
Hello Tamouse, Thank you so much for your reply, Where trying $('#pic').attr('src', "<%= asset_path(wine.picture)%>");, I get the following error: undefined local variable or method `wine' for #<#:0x4311bb04> I hope I did not forget to mention that. wine.picture is a dynamic variable. Thanks

Re: [Rails] I am getting a ' undefined method error ' when saving a comment

2013-08-22 Thread Colin Law
On 22 August 2013 20:56, ank k. wrote: > hi!! I am a newbie in ROR. > > I have two models > > Post > has_many :Comment that should be has_many :comments note that it is plural and lower case > > > Comment > belongs_to :Post belongs_to :post > > > the error displays when I try to save a comment

Re: [Rails] I am getting a ' undefined method error ' when saving a comment

2013-08-22 Thread Germano Teixeira
You shold use *has_many :comments* instead of *has_many :comment* Then you can call @post.comments Look this example: http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association Take a look at accepts_nested_attributes to create your posts: http://api.rubyonrails.o

[Rails] I am getting a ' undefined method error ' when saving a comment

2013-08-22 Thread ank k.
hi!! I am a newbie in ROR. I have two models Post has_many :Comment Comment belongs_to :Post the error displays when I try to save a comment related to certain post. I get the following error - undefined method `comment' for nil:

Re: [Rails] How to present Rails form datetime select in different time zone?

2013-08-22 Thread Andrew Havens
I found a way to do it. To convert the multi-parameter attributes that are submitted in the form to a specific time zone, add a method in your controller to manually convert the params into a datetime object. I chose to add this to the controller because I did not want to affect the model behav

[Rails] Re: How do I deal with ActiveRecord::RecordInvalid: Validation failed:

2013-08-22 Thread Vell
Interesting. I solved the issue finding a post from a person with the same error while trying to test. Issue was that i was trying to create an invalid object before I could test it. So instead, I assigned a valid object using Factory girl to a local variable then tested that the save was false

Re: [Rails] Devise Gem

2013-08-22 Thread Emil S
Did you get a chance to read the Devise wiki ? It's pretty straightforward : https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview - Emil On 22 August 2013 14:37, Rekha Benada wrote: > Hi, > > How to use Devise Gem in rails? What basic configuration is required for > that? I did it b

[Rails] Re: Proper rails deployment steps to DirectAdmin (or any hosting not focusing in apps) hosted server?

2013-08-22 Thread Kamil
I have a dedicated DirectAdmin server running on CentOS and what worked for me is the following: (Please note I make assumption you have default DA config setup with Apache/MySQL) 1. Install Ruby, and Rails gem 2. Install passenger: gem install passenger --pre 3. Install apache server module: p

[Rails] Top 10 Sites Built with Ruby on Rails

2013-08-22 Thread An An
Top 10 RoR sites according to Alexa search http://blog.netguru.co/post/58995145341/top-10-sites-built-with-ruby-on-rails -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Devise Gem

2013-08-22 Thread Rekha Benada
Hi, How to use Devise Gem in rails? What basic configuration is required for that? I did it but getting so many errors one after other How to use Devise Gem with Oauth2.0? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsu

Re: [Rails] Converting a Time to a String and Back in Rails 4.0.0

2013-08-22 Thread Hassan Schroeder
On Wed, Aug 21, 2013 at 8:55 PM, Phil wrote: > > It's not a 'valid' vs. invalid argument > Of course it is. What you consider valid or not is irrelevant, it's defined in the language. You happened to be lucky in picking a format (%m/%d/%Y) that worked in Ruby 1.8.7; the opposite day/month place

[Rails] How do I deal with ActiveRecord::RecordInvalid: Validation failed:

2013-08-22 Thread Vell
Hello all, I am currently writing model tests in rails 4. I am attempting to add an error to a reservation object if the total number of reservations for a given date and time has reached a pre-determined limit. When my test runs, it is hitting the appropriate code but it is raising the foll

[Rails] Re: Rails 3.2 and Streaming using response_body

2013-08-22 Thread Cam Allen
For future reference, it turns out that Rack is calling each twice on the response_body, see https://groups.google.com/forum/#!topic/rack-devel/YgEzAlZd8YA Once i added some checks to only stream once on the second call (rack closing the connection) it worked as expected! Note: if you only res

[Rails] Re: Why are generators not menus or prompts?

2013-08-22 Thread Matt Jones
On Wednesday, 21 August 2013 05:42:37 UTC-4, Joe Le Brech wrote: > > wouldn't it be more efficient to have a generator ask for column names and > types and indexes in a prompt? > > or easier at least. > > Generators will *always* need to accept arguments - it's how (for instance) the resource g

[Rails] Re: duplicated log lines in console

2013-08-22 Thread Erwin
[SOLVED] issue coming from rails_12factor gem ( to be used when deployed on Heroku in production) I modified my gem file... # heroku recommended gem gem 'rails_12factor' , group: :production Le jeudi 22 août 2013 12:48:42 UTC+2, Erwin a écrit : > > my app seems to be running fine in dev mode (

Re: [Rails] Why are generators not menus or prompts?

2013-08-22 Thread Joe Le Brech
I think cakephp does a slightly better job of generators than rails. On Wednesday, August 21, 2013 11:34:14 AM UTC+1, Jordon Bedwell wrote: > > On Wed, Aug 21, 2013 at 4:42 AM, Joe Le Brech > > > wrote: > > wouldn't it be more efficient to have a generator ask for column names > and > > types

[Rails] duplicated log lines in console

2013-08-22 Thread Erwin
my app seems to be running fine in dev mode ( Rails4, Devise, OAuth2 , Doorkeeper ) but looking at the console , I can see all log lines duplicated where should I look for any tricky bug or missing param ?anyway to get more info on what's happening ? thanks a lot for feedback (ruby-2.0.0

Re: [Rails] Rails tutorial; CRD working, U failing

2013-08-22 Thread Colin Law
On 21 August 2013 19:01, wrote: > Using http://guides.rubyonrails.org/getting_started.html as a guide. > Create, Read, Delete all work. Update fails: > > NoMethodError in WordsController#update > ... > class WordsController < ApplicationController > ... > def update > @word = Word.find(par

Re: [Rails] How to present Rails form datetime select in different time zone?

2013-08-22 Thread Colin Law
On 22 August 2013 00:59, Andrew Havens wrote: > Hello, > > I have a Rails application with a default time zone of UTC. This works fine > for almost everything. Now I have a situation where I would like to present > the values in a datetime_select offset by a specific time zone. As far as I > know,

[Rails] Rails tutorial; CRD working, U failing

2013-08-22 Thread rick . toews
Using http://guides.rubyonrails.org/getting_started.html as a guide. Create, Read, Delete all work. Update fails: NoMethodError in WordsController#update private method `update' called for # (I chose to make a list of words rather than of posts.) The Request parameters: {"utf8"=>"✓", "_me

[Rails] syntax error, unexpected tRPAREN raised in server log

2013-08-22 Thread ianchoi
In my server log, I am seeing this error message that is raised in activesupport. 2013-08-12T23:06:08.932580+00:00 app[web.2]: SyntaxError (/app/vendor/bundle/jruby/1.9/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:374: syntax error, unexpected tRPAREN 2013-08-12T23:06:08.932580+00

[Rails] How to present Rails form datetime select in different time zone?

2013-08-22 Thread Andrew Havens
Hello, I have a Rails application with a default time zone of UTC. This works fine for almost everything. Now I have a situation where I would like to present the values in a datetime_select offset by a specific time zone. As far as I know, this helper does not have an option to specify the tim

[Rails] Regarding the design of ActiveSupport::TimeZone

2013-08-22 Thread Matt Johnson
Hello, I am relatively new to RoR, but vastly experienced with time zones and date/time issues on other multiple other platforms. I answer quite a few questions on StackOverflow in this area, and often questions about ActiveSupport::TimeZone come up. I'm hoping that someone from this forum ca