[Rails] non ascii encoding

2012-11-12 Thread Jim Ruther Nill
Hi guys! I have a company model with a name attribute. Each company is association a set of projects. I created a feature which allows users to download a csv version of these projects. The download will give you a zipped file of all projects grouped by company. So the zip file contains x numb

Re: [Rails] issue in delete a cookie ( cannot 'eat' it ..)

2012-11-12 Thread Erwin
It's not useful in my case , as I am using FB & Google authentification, the callback can be set only to the main domain using the :state parameter I can redirect to the calling subdomain on FB/Google callback but before the redirect I need to delete the previous session/cookies ( user may hav

Re: [Rails] issue in delete a cookie ( cannot 'eat' it ..)

2012-11-12 Thread Greg Donald
On Mon, Nov 12, 2012 at 11:47 AM, Erwin wrote: > I set my cookies at root domain level ( lvh.me in dev) , accessible from > within each subdomain > w session store initializer : > Rails.application.config.session_store :active_record_store, :key => > '_tests_session', :domain => :all Did you tr

Re: [Rails] Rails Guide:"For belongs_to associations, has_many inverse associations are ignored." not clear?

2012-11-12 Thread Greg Donald
On Mon, Nov 12, 2012 at 4:09 AM, Paul Leader wrote: > Perhaps I'm bing a bit thick and missing something obvious (possible), but I > found the caveats listed in section 3.5 of the Associations Rails Guide > badly worded and confusing. > > The section gives an example with a has_many <-> belongs_to

Re: [Rails] Updating objects in arrays

2012-11-12 Thread Greg Donald
On Mon, Nov 12, 2012 at 1:42 PM, byrnejb wrote: > I have an array of 10 ActiveRecord objects. I wish to iterate over the > array and update an attribute. When I do this the underlying table row > changes but the object in the array frequently does not. For example: > > count = 0 > current_en

Re: [Rails] NEW TO PHP...RUBY ON RAILS?

2012-11-12 Thread Greg Donald
On Sun, Nov 11, 2012 at 10:18 AM, Luis Vasconcellos wrote: > If you want a web development job, I would suggest that you learn first the > basics of html5/css/javascript, No doubt. This alone should keep a complete newbie busy for many months, if not longer. -- Greg Donald -- You received t

[Rails] Rails with Rack 1.4.1 and malformed cookies; advice needed.

2012-11-12 Thread Bryan Shelton
I'm looking for advice as to the best way to handle a bug in Rack 1.4.1. The bug has been fixed upstream, but Rack ~> 1.4.0 is the requirement for Rails stable right now, which will mean 1.4.1. Rack HEAD causes a warning message to be displayed when using the cookie session store, which is some

[Rails] Can anyone tell me about my website

2012-11-12 Thread John H
Hello Can anyone tell me how my site is doing getting picked up by google. We dont seem to come up in searches i do on topics we have posted. The site has been live since july 2012. This may not be relevant for this group, but i know the site has been designed with ruby. I dont know much

[Rails] Rails Guide:"For belongs_to associations, has_many inverse associations are ignored." not clear?

2012-11-12 Thread Paul Leader
Perhaps I'm bing a bit thick and missing something obvious (possible), but I found the caveats listed in section 3.5 of the Associations Rails Guide badly worded and confusing. The section gives an example with a has_many <-> belongs_to rel

[Rails] Re: NEW TO PHP...RUBY ON RAILS?

2012-11-12 Thread Aydar Omurbekov
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-

[Rails] regarding ROR opportunity

2012-11-12 Thread Saritha Kilaru
Hi All. We have a ROR opportunity with our clients in Milpitas,CA which is a fulltime opportunity please do let me know if you would be interested. 4+ years of web development experience of consumer apps with cross-browser compatibility requirements Proficiency with all web technologies includi

[Rails] [SOLVED] Updating objects in arrays

2012-11-12 Thread James B. Byrne
On Mon, November 12, 2012 15:44, Colin Law wrote: > On 12 November 2012 19:42, byrnejb wrote: >> Perhaps this is a Rails issue. However, I need to first determine >> whether I simply am missing something about updating members of >> an array. >> >> I have an array of 10 ActiveRecord objects. I

Re: [Rails] Updating objects in arrays

2012-11-12 Thread Colin Law
On 12 November 2012 19:42, byrnejb wrote: > Perhaps this is a Rails issue. However, I need to first determine whether I > simply am missing something about updating members of an array. > > I have an array of 10 ActiveRecord objects. I wish to iterate over the > array and update an attribute. W

[Rails] Updating objects in arrays

2012-11-12 Thread byrnejb
Perhaps this is a Rails issue. However, I need to first determine whether I simply am missing something about updating members of an array. I have an array of 10 ActiveRecord objects. I wish to iterate over the array and update an attribute. When I do this the underlying table row changes bu

[Rails] issue in delete a cookie ( cannot 'eat' it ..)

2012-11-12 Thread Erwin
I set my cookies at root domain level ( lvh.me in dev) , accessible from within each subdomain w session store initializer : Rails.application.config.session_store :active_record_store, :key => '_tests_session', :domain => :all ( good for persisted facebook authentication when user login into a

[Rails] Re: undefined method `original_filename' for nil:NilClass

2012-11-12 Thread Anna
Now is solved, just in case that somebody will has the same problem, here is the solution, the view was right, I just change the controller part: *collection_action :status_race, :method => :post do* * * *uploaded_io = params[:routes_status_race][:uploaded_data]* * * *File.open(Rails.root

[Rails] undefined method `original_filename' for nil:NilClass

2012-11-12 Thread Anna
Hi, although I saw this problem in other blogs, I couldn't make it works. My view: *<%= semantic_form_for :routes_status_race, :url => status_race_admin_routes_path do |f| %>* * <% contact_array = Contact.all.map {|contact| [contact.name, contact.id]}%>* * <% route_importer_array = RouteImporter

Re: [Rails] How can I change the notice to a text with a variable

2012-11-12 Thread Jordon Bedwell
redirect_back_or_to(:users, notice: "Welcome, #{@user.username}") Though you shouldn't do that in the redirect, you should probably just make that a default part of the view if the session has a user_id. On Mon, Nov 12, 2012 at 5:19 AM, roelof wrote: > Hello, > > I have this controller : > > cla

Re: [Rails] How can I change the notice to a text with a variable

2012-11-12 Thread Norbert Melzer
:notice => "welcome #{@user.name}" That's basic ruby knowledge Am 12.11.2012 12:19 schrieb "roelof" : > Hello, > > I have this controller : > > class UserSessionsController < ApplicationController > skip_before_filter :require_login, :except => [:destroy] > def new > @user = User.new >

[Rails] How can I change the notice to a text with a variable

2012-11-12 Thread roelof
Hello, I have this controller : class UserSessionsController < ApplicationController skip_before_filter :require_login, :except => [:destroy] def new @user = User.new end def create respond_to do |format| if @user = login(params[:username],params[:password]) for

Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Mirri Kim
Hi Soichi, You can temporarily do `if @plan.save!` to raise an error instead of just having it return false and not give you any feedback. Doing this is okay because you should not bother testing your validations as far as the controller is concerned (you do that on your model). In any case, try t

Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Norbert Melzer
What he wants to say is that you should log or print the error-array of your model and look what exactly doesn't fit into your validations. Am 12.11.2012 11:13 schrieb "Soichi Ishida" : > > On your controller, use `create!` to see what is preventing the save. > > Sorry, I don't quite understand wh

[Rails] Re: RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
> On your controller, use `create!` to see what is preventing the save. Sorry, I don't quite understand what you mean. my plans_controller.rb has def create @plan = Plan.new(params[:plan]) respond_to do |format| if @plan.save format.html { redirect_to @plan, notice: 'Pla

[Rails] Factory girl associations and rspec

2012-11-12 Thread Shaban K.
Hi, I am trying to test factory girl associations basically I have a user model and status model , what is supposed to happen is a user has many statuses and a status belongs to a user. I have tried to model this in factory girl as you can see in the files. When I try to execute the test I get F

[Rails] Re: RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
> Where do you define valid attributes? > You mean, def valid_attributes FactoryGirl.build(:plan).attributes end in plans_controller_spec.rb ? Even if so, I am not sure if it's a right way. soichi -- Posted via http://www.ruby-forum.com/. -- You received this message because yo

Re: [Rails] RSpec: controller POST create

2012-11-12 Thread Mirri Kim
On your controller, use `create!` to see what is preventing the save. On Mon, Nov 12, 2012 at 5:19 PM, Soichi Ishida wrote: > Rails 3.1.3 > rspec-rails (2.11.4) > rspec 2.11.1 > > I am new to rspec. I don't quite understand tests for POST create part. > > I have generated scaffold, and simultan

Re: [Rails] RSpec: controller POST create

2012-11-12 Thread Norbert Melzer
Where do you define valid attributes? Have you tried post :plan => Factory(:plan)? Am 12.11.2012 10:19 schrieb "Soichi Ishida" : > Rails 3.1.3 > rspec-rails (2.11.4) > rspec 2.11.1 > > I am new to rspec. I don't quite understand tests for POST create part. > > I have generated scaffold, and simu

[Rails] RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
Rails 3.1.3 rspec-rails (2.11.4) rspec 2.11.1 I am new to rspec. I don't quite understand tests for POST create part. I have generated scaffold, and simultaneously it generated controller_spec.rb as well. it "assigns a newly created plan as @plan" do post :create, {:plan => valid