[Rails] causes of occasional ActionController::InvalidAuthenticityToken exceptions

2010-10-08 Thread drewB
A few times a week we get an ActionController::InvalidAuthenticityToken exception from our app (not all from the same action or controller). I understand why protect_from_forgery exists and am not interested in disabling it. I am quite certain this is not from actual attacks on our site but not s

[Rails] Advice on recruiting rails developers

2010-05-04 Thread drewB
Other than working with a recruiter or posting jobs on craigslist, dice, or this group, do people have any suggestions for good resources for finding developers in the bay area or philadelphia? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

[Rails] Can you recommend a great agile training program in the Bay Area?

2010-04-20 Thread drewB
Can anyone recommend a good few day training program for running agile teams in the Bay Area? I know there are a bunch out there but I was looking for some first hand recommendations. Basically, I am looking for a program that will help me implement agile processes in the development team I run.

[Rails] declaring migration bankruptcy

2010-03-26 Thread drewB
I joined a project recently that has 2 years worth of migrations. It is about to go into production and I am wondering if we should consider clearing out most of the history. A poor decision made early on has caused the project to have about 20 custom plugins (all of which really belong in the ap

[Rails] Re: Adding files for autotest to monitor

2010-02-21 Thread drewB
After a lot of hunting I figure it out. I added the following to my .autotest: Autotest.add_hook :initialize do |at| at.add_mapping(%r%^spec/(integration)/.*rb$%) { |filename, _| filename } end On Feb 19, 1:24 pm, drewB wrote: > I am using autotest with RS

[Rails] Adding files for autotest to monitor

2010-02-19 Thread drewB
I am using autotest with RSpec (autospec) and for some reason it doesn't monitor files under the integration folder. Does anyone know how to config autotest to monitor additional paths? I tried playing with add_mapping in my .autotest but was not able to get it to work. Thanks! P.S. I know that

[Rails] Re: ActiveRecord is being converted to Hash unexpectedly

2009-10-26 Thread drewB
Koser wrote: > drewB wrote: > > On Oct 26, 9:51 am, Marnen Laibow-Koser > s.net> wrote: > > >> No! Create shouldn't be a controller method. > > > Why not? > > Sorry, that was a flash of abject stupidity on my part. :)  Please feel > free to ignore it. &g

[Rails] Re: ActiveRecord is being converted to Hash unexpectedly

2009-10-26 Thread drewB
On Oct 26, 9:51 am, Marnen Laibow-Koser wrote: > Wes wrote: > > Try this: > > > class ObjectivesController < ApplicationController > >   before_filter :require_user > >   layout false > >   def create > >     objective = current_user.objectives.create(params[:objective]) > >   end > > end > > No

[Rails] Re: ActiveRecord is being converted to Hash unexpectedly

2009-10-26 Thread drewB
On Oct 26, 6:03 am, Frederick Cheung wrote: > On Oct 26, 12:49 pm, Marnen Laibow-Koser > s.net> wrote: > > > Then create a method with a different name -- say, create_with_user_id > > -- or use a before_create callback to set the user_id.  Don't override > > create. > > or in this case, using a

[Rails] Re: ActiveRecord is being converted to Hash unexpectedly

2009-10-25 Thread drewB
It is overwritten because the objective requires a user_id which comes from a different place than the other attributes. I could simply use create and add more code at the controller level but I prefer to push that down to the model. On Oct 25, 2:15 pm, Marnen Laibow-Koser wrote: > drewB wr

[Rails] Re: ActiveRecord is being converted to Hash unexpectedly

2009-10-25 Thread drewB
Thanks for your reply. On Oct 25, 6:07 am, bonyfish choi wrote: > hi,drewB >   first,I don't agree about the code of create method,use another > method name seems better. Why don't you agree? >   second,you mentioned that "objective.class" will return Hash? It

[Rails] Re: ActiveRecord is being converted to Hash unexpectedly

2009-10-24 Thread drewB
I should mention that the Hash does contain the Objective's data. the reason it is important that Objective is returned instead of Hash is because I want to be able to call methods on it. On Oct 24, 8:31 am, drewB wrote: > I am running into a very odd problem.  I have an ActiveRecor

[Rails] ActiveRecord is being converted to Hash unexpectedly

2009-10-24 Thread drewB
I am running into a very odd problem. I have an ActiveRecord called Objective with a public create method. When this method is called in a controller the return value is a Hash instead of Objective. When I test the method in Rspec for the model it returns as Objective. Does anyone have an idea

[Rails] Re: test driven development advice

2009-09-28 Thread drewB
Thanks for the tips. I just got the beta version Pragmatic Bookshelf Rspec and am working through it now. On Sep 27, 4:29 pm, Marnen Laibow-Koser wrote: > drewB wrote: > > I am attempting to use Test Driven Development for the first time and > > was hoping for a little advice. &

[Rails] test driven development advice

2009-09-27 Thread drewB
I am attempting to use Test Driven Development for the first time and was hoping for a little advice. I am just starting a new section of the website that will ultimately contain a couple controllers and about 6 models. If I am going to write my tests before any code, I need to decide whether to

[Rails] Re: customize active record attribute display name in error message

2009-09-26 Thread drewB
you call "humanize" on it.  Try this: > > class Post < ActiveRecord::Base > >   HUMANIZED_COLUMNS = {:msg => "Message"} > >   def self.human_attribute_name(attribute) >     HUMANIZED_COLUMNS[attribute.to_sym] || super >   end > end > >

[Rails] Re: customize active record attribute display name in error message

2009-09-25 Thread drewB
09 at 4:49 PM, drewB wrote: > > > Is there an easy way to customize the display name of the attributed > > used in a validation error message.  For example, let's say I have an > > active record with the attribute :msg that is validated for presence. > > If is doesn'

[Rails] customize active record attribute display name in error message

2009-09-25 Thread drewB
Is there an easy way to customize the display name of the attributed used in a validation error message. For example, let's say I have an active record with the attribute :msg that is validated for presence. If is doesn't exist I don't want the user to see "msg can't be blank!" I want it to say

[Rails] Re: Testing: 'test "..." do' works but not 'def test...'

2009-09-24 Thread drewB
That was it. I didn't know you had to start with "test." Thanks so much! On Sep 24, 9:28 am, "Jeffrey L. Taylor" wrote: > Quoting drewB : > > > > > I have just encountered a funny situation.  I have a number of > > functional and unit cases

[Rails] Testing: 'test "..." do' works but not 'def test...'

2009-09-24 Thread drewB
I have just encountered a funny situation. I have a number of functional and unit cases that are all written with the notation: def #test case end I just created a new model and controller with test cases written in a similar format. When I run the test cases, no test are actually run (

[Rails] using _url helper in unit test

2009-09-16 Thread drewB
I have a actionmailer model that send the user a URL to the website for account activation. In my unit tests for the model I want to ensure that the correct URL is being generated. In the test I have the following: assert sent.body.include? new_account_activation_url(:activation_code => user.pe

[Rails] Re: what should be server-side and what should be client-side

2009-08-21 Thread drewB
Interesting thoughts all around. I agree if making your site accessible to clients without javascript is important than you definitely should go with the server-side solution. The type of site I had in mind when starting the conversation would be pretty useless if someone didn't have javascript

[Rails] what should be server-side and what should be client-side

2009-08-20 Thread drewB
I have been thinking lately about what should be executed client-side vs. server-side and was curious what others thoughts are. Let's take the following example. A user has selected X pieces of furniture. On a single page, they are shown a list of the furniture items with specific info about ea