[Rails] to_json problem (Rails2.2.2)

2009-02-23 Thread 浩翔
Hi all, i got a record from my project server side database, like this : @user = User.find 1 then i cover @user to json format: @user.to_json the result : created_at: 2009-01-28T12:29:32Z what's the T and Z of created_at field ? but i change

[Rails] Re: to_json problem (Rails2.2.2)

2009-02-23 Thread 浩翔
Time Zone ? how to delete T Z ? On Feb 23, 4:02 pm, 浩翔 blackange...@gmail.com wrote: Hi all, i got a record from my project server side database, like this : @user = User.find 1 then i cover @user to json format: @user.to_json the result :

[Rails] Ruby1.9.1 Bus Error

2009-02-23 Thread Rick
Here's my particulars: Mac OS X 10.5.6 1.25 GHz PPC G4 /test 726 script/about /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.0/lib/ action_controller/routing/segments.rb:6: warning: encoding option is ignored - N About your application's environment Ruby version 1.9.1

[Rails] Re: Strange error when running rails 2.3 on ruby 1.9.1 on FreeBSD

2009-02-23 Thread David Nugent
On 23/02/2009, at 8:04 AM, Grzesiu wrote: Hi Conrad, I am just starting my adventure with rails, so I am trying to start with the most recent versions of ruby and rails to not have to upgrade and struggle later, when it will be the time to deploy the app. My suggestion, taken from many

[Rails] Re: sorting by subsidiary class

2009-02-23 Thread Frederick Cheung
On Feb 22, 3:48 pm, DanC d.m.coleg...@durham.ac.uk wrote: i.e. in my categories controller     @category = Category.find(params[:id])     @services=Service.find(:all, :order = XXX, :conditions = ['category_id = ?', @category.id]) If you join the discounts table you can just order by

[Rails] Re: Hash and Array

2009-02-23 Thread Cyrus Dev
Yes fred I modify that array and hash that is my question.. Can I do that array like original like activ record array ? using any ruby or rails functions ? thanks Frederick Cheung wrote: On Feb 21, 12:06�pm, Cyrus Dev rails-mailing-l...@andreas-s.net wrote: but after modifying this

[Rails] Re: Inserting string with special character in database.

2009-02-23 Thread Anubhaw Prakash
Jeffrey L. Taylor wrote: Quoting Anubhaw Prakash rails-mailing-l...@andreas-s.net: Hi all. I am having trouble in reading string containing special characters from file and storing them in database. For example, for string like '\x89\xA5\xCFI w...' it throws error Incorrect string value.

[Rails] Re: to_json problem (Rails2.2.2)

2009-02-23 Thread David Nugent
On 23/02/2009, at 7:02 PM, 浩翔 wrote: Hi all, i got a record from my project server side database, like this : @user = User.find 1 then i cover @user to json format: @user.to_json the result : created_at: 2009-01-28T12:29:32Z what's the T and Z of

[Rails] activemerchant + activesupport install/dependency issues

2009-02-23 Thread will....@gmail.com
Hi all: Saw the awesome railscasts episode on activemerchant and am going to give it a try, but keep running into this install problem that I can't figure out: after installing activemerchant as a gem, my rake keep aborting with this error: /Library/Ruby/Site/1.8/rubygems.rb:149:in `activate':

[Rails] Problems installing acts_as_list plugin

2009-02-23 Thread Daniel Liebig
Hi There, i'm using Ruby 1.8.6 on Rails 2.2.2 on a Mac OSX 10.5.4 and i'm trying to use acts_as_list in a project. While testing with rake test:units i got an [..] `method_missing': undefined method `acts_as_list' [...] Error. After googeling a while i changed into the project directory and

[Rails] Re: Inserting string with special character in database.

2009-02-23 Thread Priya Buvan
Anubhaw Prakash wrote: Hi all. I am having trouble in reading string containing special characters from file and storing them in database. For example, for string like '\x89\xA5\xCFI w...' it throws error Incorrect string value. The string should be wrappped in duoble quotes, but i didn't

[Rails] Re: Problems installing acts_as_list plugin

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 09:48, Daniel Liebig wrote: I tried ruby script/plugin install git://github.com/rails/acts_as_list.git as well, got no reply, looked like success. But the unit test still failed. Running the git-install again lead to the already installed message. I'm a bit confused,

[Rails] pass a varible from view to controller

2009-02-23 Thread Ishara Gunathilake
please can anyone suggest me a code to pass a variable whichis in the view to controller --~--~-~--~~~---~--~~ 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

[Rails] Active Scaffold

2009-02-23 Thread Priya Buvan
Hi all, I'm using activescaffold in my application. I have installed that plugin. When i click the link for active scaffold UI, i' getting the following error. Please help me to recover this problem. undefined local variable or method `calendar_date_select_javascripts' for

[Rails] Re: pass a varible from view to controller

2009-02-23 Thread Priya Buvan
Ishara Gunathilake wrote: please can anyone suggest me a code to pass a variable whichis in the view to controller Can you please provide the exact problem? So that can try for solution. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] background process

2009-02-23 Thread Ankit Parekh
Hi all I am working on a heavy engineering project. And the requirement is that I needto do a lot of process before I store the data to the db. Now the question is that I want to do the process that I am doing but I want to do it in the background. What I actually mean to say is that..I just

[Rails] Disable double-click with link_to_remote

2009-02-23 Thread David
I'm using link_to_remote to load and show a number of partials and am looking for a way to prevent multiple clicks on the link. I tried searching around, but couldn't really find anything. The way it is set up now is that if a user double clicks fast enough, two ajax requests are sent to the

[Rails] Re: Disable double-click with link_to_remote

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 10:46, David wrote: I'm using link_to_remote to load and show a number of partials and am looking for a way to prevent multiple clicks on the link. I tried searching around, but couldn't really find anything. The way it is set up now is that if a user double clicks

[Rails] Re: background process

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 10:38, Ankit Parekh wrote: Hi all I am working on a heavy engineering project. And the requirement is that I needto do a lot of process before I store the data to the db. Now the question is that I want to do the process that I am doing but I want to do it in

[Rails] Re: background process

2009-02-23 Thread Harm
Spawn is dead easy (http://rubyforge.org/projects/spawn/). I used it to great effect for sending emails while making the user think they where all already sent. The others Frederick suggested work but are more trouble than starling/workling. Harm On Feb 23, 12:14 pm, Frederick Cheung

[Rails] Re: pass a varible from view to controller

2009-02-23 Thread Conrad Taylor
On Mon, Feb 23, 2009 at 2:37 AM, Priya Buvan rails-mailing-l...@andreas-s.net wrote: Ishara Gunathilake wrote: please can anyone suggest me a code to pass a variable whichis in the view to controller Can you please provide the exact problem? So that can try for solution. Hi, I agree

[Rails] Re: background process

2009-02-23 Thread Ankit Parekh
thanks for your reply but i dont want to run something like a cron job or nething. Since my method is very long i want it to run in background. So that the user dont need to wait on that page while the process is going on. Is there something where i can define that a particular method should

[Rails] Re: creating a rails plugin

2009-02-23 Thread Maurício Linhares
What you`re looking for is a way to configure your plugin, the simplest way to do it is just let the user reopen your classes and change what is need in a initialization file. You could also create a configuration file and have your plugin to load it and configure the pieces that are

[Rails] Re: background process

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 11:44, Ankit Parekh wrote: thanks for your reply but i dont want to run something like a cron job or nething. Since my method is very long i want it to run in background. So that the user dont need to wait on that page while the process is going on. Is there

[Rails] Re: how to add javascript directly to the view

2009-02-23 Thread Adam Akhtar
Hi thanks for the reply. What i did in the end was to type the no records message into the view directly so that non javascript enabled users could still see it. I then created some javascript code to handle the situations above. Thanks everyone for yoru help. it really helped me out --

[Rails] Textarea and line breaks

2009-02-23 Thread shahroon ali
Hi everyone! Guys I am facing very irritating problem of line breaks in text area, i used gsub method to replace \r\n to br/, but i didn't got the result as was i expecting. Could anybody give me any suggestions to resolve this issue? Thanks, Shahroon

[Rails] Re: Textarea and line breaks

2009-02-23 Thread Peter De Berdt
On 23 Feb 2009, at 13:07, shahroon ali wrote: Guys I am facing very irritating problem of line breaks in text area, i used gsub method to replace \r\n to br/, but i didn't got the result as was i expecting. Could anybody give me any suggestions

[Rails] Re: Textarea and line breaks

2009-02-23 Thread shahroon ali
simple_format gave me this pJames, br /Andy, br /Candy/p but i want line breaks like this James Andy Candy I hope now you can understand what my problem is. Thanks, Shahroon On Mon, Feb 23, 2009 at 5:10 PM, Peter De Berdt peter.de.be...@pandora.bewrote: On 23 Feb 2009, at 13:07, shahroon

[Rails] Re: pass a varible from view to controller

2009-02-23 Thread MaD
basically you got two possibilities: 1. write the value into a session-variable session[:wtf] = some string or value 2. pass your value as a parameter to some action and read params in your controller: view: %= link_to my_action :controller = :bla, :action = :my_action, :wtf = some string

[Rails] hiding form when clicking outside field

2009-02-23 Thread Adam Akhtar
im guessing this is somethign to do with prototype but i want a form which comprises of one field to disapear if the user clicks anywhere outside of that field. Ive seen this doen on rememberthemilk.com but not sure how its done in rails. if anyone could point me in the right direction id

[Rails] Textarea and line breaks

2009-02-23 Thread shahroon ali
Sending again :) simple_format gave me this pJames, br /Andy, br /Candy/p but i want line breaks like this James Andy Candy I hope now you can understand what my problem is. Thanks, Shahroon On Mon, Feb 23, 2009 at 5:10 PM, Peter De Berdt peter.de.be...@pandora.bewrote: On 23 Feb 2009,

[Rails] Re: pass a varible from view to controller

2009-02-23 Thread shahroon ali
Yes On Mon, Feb 23, 2009 at 5:26 PM, MaD mayer.domi...@gmail.com wrote: basically you got two possibilities: 1. write the value into a session-variable session[:wtf] = some string or value 2. pass your value as a parameter to some action and read params in your controller: view: %=

[Rails] Re: Textarea and line breaks

2009-02-23 Thread MaD
Sending again :) why? was 24 minutes of waiting too long? I hope now you can understand what my problem is. no, not really. anyhow: pJames, br /Andy, br /Candy/p this is actually what i thought you are trying to achieve after reading this: i used gsub method to replace \r\n to br/ now, i

[Rails] Re: Multiple image upload

2009-02-23 Thread hafeez
Hi Athreya., For multiple image uploading rails is having a plugin so called :paperclip.. Use this plugin , u can implement multiple image uploading in rails. for this plugin visit the below link: http://github.com/thoughtbot/paperclip/tree/master And for implementation: Readme file in that

[Rails] Re: Textarea and line breaks

2009-02-23 Thread shahroon ali
:) , that was not an issue of waiting actually I thought my emails are going some where else due to this message of boxbe, so thats why. Now come to real issue, actually Mayer i have a text area for entering a list of developers or list of anything like this 1. Abcd 2. this is my second line 3.

[Rails] Re: Textarea and line breaks

2009-02-23 Thread shahroon ali
Okay thanks, I got the solution. thats simply (@vteam.developers).gsub(\n,br/) Shahroon On Mon, Feb 23, 2009 at 6:33 PM, shahroon ali shahroon@gmail.comwrote: :) , that was not an issue of waiting actually I thought my emails are going some where else due to this message of boxbe, so

[Rails] Re: Multiple image upload

2009-02-23 Thread Ar Chron
There's also swfupload (google for the details), which has worked fine for me. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: Action Caching in Rails?

2009-02-23 Thread Ar Chron
You might want to check out fragment caching where you can take more control over what fragments are expired when... Action caching mixed with Ajax might be your issue, although I haven't experimented with that mix. I used fragment_caching long before I started Ajax-ifying (is that even a

[Rails] Re: How can I know if a file has been attached?

2009-02-23 Thread Jeff
On Feb 22, 9:08 pm, Guillaume Loader rails-mailing-l...@andreas- s.net wrote: Hello everyone! I have a form where we can attach files to a post. But I want to do different things depending wether a file is attached or not. So my question is : it it possible to know if a file is attached? I

[Rails] Re: Inserting string with special character in database.

2009-02-23 Thread Jeffrey L. Taylor
Quoting Anubhaw Prakash rails-mailing-l...@andreas-s.net: Jeffrey L. Taylor wrote: Quoting Anubhaw Prakash rails-mailing-l...@andreas-s.net: Hi all. I am having trouble in reading string containing special characters from file and storing them in database. For example, for string

[Rails] Re: Problem with presentation of error messages and multiple objects

2009-02-23 Thread Stefan Frede
For everyone running in something similar. In my case the problem is how I checked in my SubscriptionService that every model is valid: def valid? @payment.valid? @subscription.valid? @user.valid? end The logical and will only check the next operand if the one befor is true. So, for

[Rails] constant caching, modules and STI

2009-02-23 Thread tachekent
Hi there, I've been following one of the recipes in the Advanced Rails Recipes books, and have arrived for my own particular needs at this scenario: I want to cache some options data in constants at loadtime (as per the recipe) for dropdown menus in a form All of the different options are in a

[Rails] complex forms and :index = nil issues

2009-02-23 Thread sa 125
Hi - I'm trying to figure out how to group nested fields in the form such that they all submit with a certain order. I followed the complex forms railscast (http://railscasts.com/episodes/75), but I'm trying to submit a nested model with more than a single field. % fields_for

[Rails] best way to model user or IP

2009-02-23 Thread Daniel Choi
I'm writing a wiki-based website from scratch and would like some suggestions on the best way to deal with this common situation. A page can be edited by a logged-in and registered user or by an anonymous visitor. If a user edits the page, the model object representing the edit is associated with

[Rails] Re: best way to model user or IP

2009-02-23 Thread Daniel Choi
I forgot to mention the requirement that if an anonymous visitor edits a page, their IP address is recorded. On Feb 23, 10:58 am, Daniel Choi dhc...@gmail.com wrote: I'm writing a wiki-based website from scratch and would like some suggestions on the best way to deal with this common

[Rails] Re: Multiple image upload

2009-02-23 Thread Freddy Andersen
And if you put both together you get this tutorial: http://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/ I have used this with just one image per. model and multiple images for a model (has_many) Works and looks great --~--~-~--~~~---~--~~

[Rails] Re: complex forms and :index = nil issues

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 15:57, sa 125 wrote: When I submit, params looks strange and is completely disorganized: { project = { name = test, task_attributes = [{ start = 10:00 }, { start = 12:00 }, { end = 10:30, start = 11:00 },

[Rails] Re: constant caching, modules and STI

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 15:51, tachekent wrote: Ideally I would like something along the lines of: RnData::RN_DATA RnData::RN_AUTO RnData::RN_INCOME or just RnAuto::OPTIONS RnIncome::OPTIONS as long as it has the right info for the subclass in it, and not just the parent inherited across

[Rails] Re: Textarea and line breaks

2009-02-23 Thread shahroon ali
I know you are right, and I convinced my client as well but he insist me to do like this. Thanks, Shahroon On Mon, Feb 23, 2009 at 9:18 PM, Freddy Andersen fre...@cfandersen.comwrote: Why don't you just do a team has_many developers and add a text_field with developers that can be added???

[Rails] Re: Strange error when running rails 2.3 on ruby 1.9.1 on FreeBSD

2009-02-23 Thread Grzesiu
Hi Conrad, May I ask on which system you've got rails 2.3.0 RC1 and ruby 1.9.1 installed within an hour? I guess it was MacOS X? I am not sure if what you write applies to FreeBSD. As I wrote I haven't installed any gems for Ruby18, so all execs such as rake, gem etc refer only to ruby19.

[Rails] Re: degrading ajax calls - how?

2009-02-23 Thread Robert Walker
Shilo Ayalon wrote: Hey - I have a few ajax calls in my app that I'm not really sure how to degrade to html. For the most part, these are functions that insert or remove elements to/from the dom. def start_edit prod = params[:id] params[:row] = prod_#{prod.id} respond_to do |format|

[Rails] Tree view similar to Grid view

2009-02-23 Thread Sudhi Kulkarni
Hi, Is there a plugin similar to wice grid for tree representation? A tree control which could directly use the active record the way wice grid does it? Thanks, Sudhi -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] 2 levels or more nested :joins w/ AR search conditions

2009-02-23 Thread Shilo Ayalon
Sorry for the ambiguous title, but here's the problem: Say I have tables of cities, districts and countries such that: city belongs_to district (district has_many cities) district belongs_to country (country has_many districts) Therefore, while looping through a city I can easily access the

[Rails] Hide password params in log file

2009-02-23 Thread Fernando Perez
Hi, I just noticed that when users register or login to my website (I use restful_auth), their password gets printed out in the production.log file. How can I prevent that? I consider this a major security issue. SSL is used to prevent eavesdropping and passwords are stored encrypted in DB by

[Rails] Re: Hide password params in log file

2009-02-23 Thread Robby Russell
Fernando, filter_parameter_logging is your friend. * http://robbyonrails.com/articles/2007/07/16/rails-code-audit-tips-filtered-parameter-logging Cheers, Robby On Mon, Feb 23, 2009 at 8:38 AM, Fernando Perez rails-mailing-l...@andreas-s.net wrote: Hi, I just noticed that when users

[Rails] bug? ruby tests do not write to mysql-database

2009-02-23 Thread schtieF
Hi, i have a very strange and serious problem. In my test i create an object with (ActiveRecord::Base).create (i also tried .new and .save!) everything seems to be fine, assert *.errors.empty? is ok but there is ne entry in the database. I used the debugger command and put it right after

[Rails] Re: Hide password params in log file

2009-02-23 Thread Gregory Mazurek
in application.rb, insert: filter_parameter_logging password On Mon, Feb 23, 2009 at 11:38 AM, Fernando Perez rails-mailing-l...@andreas-s.net wrote: Hi, I just noticed that when users register or login to my website (I use restful_auth), their password gets printed out in the

[Rails] Re: 2 levels or more nested :joins w/ AR search conditions

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 16:43, Shilo Ayalon wrote: Gives the error: ActiveRecord::ConfigurationError: Association named 'country' was not found; perhaps you misspelled it? Anyone had any luck with such a thing? And what if country was linked to another model I'd like to view through city

[Rails] Re: How can I know if a file has been attached?

2009-02-23 Thread Guillaume Loader
Perfect it works! Thank you! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ 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

[Rails] Re: constant caching, modules and STI

2009-02-23 Thread tachekent
The inherited hook as you found below would do the trick. feels a bit   overkill to me - sometimes there is such a thing as too DRY. Yeah but I have at least 17 subclasses that are basically empty stubs for looking up the data and setting relationships on a model.

[Rails] Re: submit_to_remote onclick clear ?

2009-02-23 Thread Guillaume Loader
Nobody knows? :( -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ 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

[Rails] Re: best way to model user or IP

2009-02-23 Thread Sarah Mei
Create a single row in the user table to represent the anonymous user, and associate the IP address with the edit instead of with the user. That way you don't clutter your database with anonymous users but you still retain the IP for each edit. On Mon, Feb 23, 2009 at 8:00 AM, Daniel Choi

[Rails] jquery, ajax, and Internet Explorer

2009-02-23 Thread John Mark
I have a code like this that works in all browsers and not IE. That is they send the expected GET request while IE is sending a POST request. I have tested this using IE7 $.ajax({ url: this.href, type: 'get', dataType: 'script', success: function(data){ while in the view I have the

[Rails] Re: activemerchant + activesupport install/dependency issues

2009-02-23 Thread Sarah Mei
activemerchant requires activesupport = 2.0.0, and that's being loaded ok. Then some other gem is requiring activesupport 1.4.1, but since 2.1.0 is already loaded it can't load 1.4.1. You should run gem cleanup to remove old versions of activesupport. If that doesn't fix it, you'll need to

[Rails] Re: Hide password params in log file

2009-02-23 Thread Fernando Perez
in application.rb, insert: filter_parameter_logging password Thank you all for your replies. This should be included by default (or at least commented out?) in restful_auth generator and any other authentication plugin. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: geokit - using :through to connect models

2009-02-23 Thread Sarah Mei
I think your trouble here is with the polymorphic association. (Why do you need it - is there another model that has_one or has_many :internships :as = :employer?) Try either removing :polymorphic = true if you don't need it, or adding :as = :employer to the Employer's has_many :internships

[Rails] Re: constant caching, modules and STI

2009-02-23 Thread tachekent
oh, and thanks for the 'super' I always wondered what that did :) --~--~-~--~~~---~--~~ 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

[Rails] Re: submit_to_remote onclick clear ?

2009-02-23 Thread Frederick Cheung
On Feb 23, 5:26 pm, Guillaume Loader rails-mailing-l...@andreas- s.net wrote: Nobody knows? :( Well you can certainly add the usual ajax callbacks (onComplete, onSuccess etc... (and those might be preferable to a raw onclick - you might not want to reset the field if the user clicks submit

[Rails] Clear a textarea when I click on Submit

2009-02-23 Thread Guillaume Loader
Hello everyone! My page reloads itself as soon as I click on Submit. My question is : how can I clear the content which is in my textarea? I'm using the method submit_to_remote for my submit button. Thank you! -- Posted via http://www.ruby-forum.com/.

[Rails] FusionCharts empty value

2009-02-23 Thread Remco Swoany
Hi I have this method. When i run it the @arr_data returns no value, so the graph remains empty. When i hard-code the value in the array, like this @arr_data ['test', '1234'] it works. What i am doing wrong?? def stacked headers[content-type]=text/html; @arr_data = [] #Get

[Rails] Re: Ruby1.9.1 Bus Error

2009-02-23 Thread Rick
I have also posted this message to the Thin talk group as it's not clear to me whether this is a ruby or a thin problem. I have both installed thin via gem install and downloaded and built/ installed from source. I have run thin via script/server thin as indicated here and via thin start. In

[Rails] Re: Release: tiny_mce 3.2.1.1-1

2009-02-23 Thread Kieran
Hey again, Just realized I forgot to include a link to the plugin. You can find it at: http://github.com/kete/tiny_mce Regards Kieran On Feb 23, 8:06 pm, Kieran P kieran...@gmail.com wrote: Hey, Announcing the release of tiny_mce plugin 3.2.1.1-1. Changelog: * Rewrote test suite *

[Rails] ruby on rails developers..

2009-02-23 Thread dash
hey...looking for cost effective some help to manage ruby on rails site.. and do some development work... I'm in the bay area but will explore overseas options. any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Freezing rails in windows brings up a permission denied

2009-02-23 Thread Stex
Hi, it's the first time for me to get a rails-application running on webspace, so I have to freeze my application to include my gems and rails. I tried many times with new and existing applications but always got an error. I searched in the internet but it seems I'm the only one with this (or

[Rails] Re: bug? ruby tests do not write to mysql-database

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 17:09, schtieF wrote: Hi, i have a very strange and serious problem. In my test i create an object with (ActiveRecord::Base).create (i also tried .new and .save!) everything seems to be fine, assert *.errors.empty? is ok but there is ne entry in the database. I

[Rails] Re: bug? ruby tests do not write to mysql-database

2009-02-23 Thread schtieF
Are you checking by looking at the database with whatever command line   tool your db provides ? tests run inside a transaction and by default other connections can't   see uncommitted changes from another transaction. I'm using phpMyAdmin to look at the database used for my tests. That

[Rails] Re: bug? ruby tests do not write to mysql-database

2009-02-23 Thread Frederick Cheung
On 23 Feb 2009, at 20:24, schtieF wrote: Are you checking by looking at the database with whatever command line tool your db provides ? tests run inside a transaction and by default other connections can't see uncommitted changes from another transaction. I'm using phpMyAdmin to look

[Rails] How to get cursor / lazy semantics from find(:all)

2009-02-23 Thread Kevin Scaldeferri
I'm trying to figure out it there's some alternative to find(:all) that can avoid instantiating every object at once, when I know that I'm just going to iterate over the collection and throw it away. E.g. def batch_process User.find(:all).each do |user| batch_process_one_user(user)

[Rails] Re: How to get cursor / lazy semantics from find(:all)

2009-02-23 Thread Frederick Cheung
On Feb 23, 8:28 pm, Kevin Scaldeferri kevin+goo...@scaldeferri.com wrote: I'm trying to figure out it there's some alternative to find(:all)   that can avoid instantiating every object at once, when I know that   I'm just going to iterate over the collection and throw it away.  E.g.

[Rails] Re: Ruby1.9.1 Bus Error

2009-02-23 Thread Rick
More info: In rails (2.3.0) generated test app 1) Ran script/server and default WEBrick started and functioned fine at least through the rails provided index.html. 2) Halted script/server 3) Ran script/server thin and produced the reported bus error 4) Ran script/server and default WEBrick now

[Rails] Re: bug? ruby tests do not write to mysql-database

2009-02-23 Thread Stefan Lischke
Thats bad, how can i disable this feature. I also need to look at the database when debugging my tests. Its not a problem for me to pay the cost of reloading the fixtures which i do not use. thanx in advance schtief 2009/2/23 Frederick Cheung frederick.che...@gmail.com: On 23 Feb 2009, at

[Rails] Refreshing browser after form submit and redirect bug

2009-02-23 Thread Fernando Perez
Hi, Let's say I have a form I submit restfully to the update action of a controller. On successful update, the application redirects to the index action. Now in some of my forms if I hit the refresh button on my index page, the browser wants to resubmit the form! How is that possible? I can see

[Rails] Re: Ruby1.9.1 Bus Error

2009-02-23 Thread Sarah Mei
http://redmine.ruby-lang.org/issues/show/1080 http://redmine.ruby-lang.org/issues/show/1142 Ruby 1.8.7 is more stable. On Mon, Feb 23, 2009 at 12:50 PM, Rick richard.t.ll...@gmail.com wrote: More info: In rails (2.3.0) generated test app 1) Ran script/server and default WEBrick started

[Rails] rspec dependencies

2009-02-23 Thread Arshak Navruzyan
Hello, I followed this http://cheat.errtheblog.com/s/rspec/ to try to get rspec working with rails 2.2.2 and installed rspec and rack gems but I'm still getting the following messages c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_re quire': no such file to

[Rails] .specification or .gemspec?

2009-02-23 Thread Candace Wong
Hi, I am currently working on Heroku (herokugarden.com) and pushing to the Heroku Git repo from my local computer. I am also installing gems on local. When I install gems locally, they generate .gemspec files in a specification/ folder. However, when I push through to Heroku, it tells me that

[Rails] Re: rspec dependencies

2009-02-23 Thread Robby Russell
Try these instructions: http://wiki.github.com/dchelimsky/rspec/rails The cheat for rspec could be out of date. Robby On Mon, Feb 23, 2009 at 1:20 PM, Arshak Navruzyan rails-mailing-l...@andreas-s.net wrote: Hello, I followed this http://cheat.errtheblog.com/s/rspec/ to try to get

[Rails] Re: bug? ruby tests do not write to mysql-database

2009-02-23 Thread Frederick Cheung
On Feb 23, 8:50 pm, Stefan Lischke lisc...@googlemail.com wrote: Thats bad, how can i disable this feature. I also need to look at the database when debugging my tests. Its not a problem for me to pay the cost of reloading the fixtures which i do not use. You can turn off transaction

[Rails] Re: Ruby1.9.1 Bus Error

2009-02-23 Thread Rick
I know it's more stable, 1.8.6 is also more stable and faster than 1.8.7 to boot. I'm interested in moving forward under the (usually valid) assumption that 1.9 - when it gets there - will include system improvements that make the possible pain worth bearing. This isn't a course I'ld follow if

[Rails] How to set up fixtures to use ActiveRecord callbacks?

2009-02-23 Thread Michael J . I . Jackson
Hi all, I have a rake task that is seeding my database. This is so I can drop and recreate the entire database and then add some company accounts very easily. My rake file (lib/tasks/database.rake) looks like this: namespace :db do desc Load seed fixtures (from db/fixture) into the

[Rails] Re: How to set up fixtures to use ActiveRecord callbacks?

2009-02-23 Thread Sarah Mei
I've found the easiest way to do this is to put hashed passwords in the fixtures, i.e. user_1: id: 1 email: u...@mysite.com.test password: ae135e826bbd76cf593d8db38c02ed2e134e159f #test On Mon, Feb 23, 2009 at 1:52 PM, Michael J. I. Jackson mjijack...@gmail.com wrote: Hi all, I have a

[Rails] Remove www from url

2009-02-23 Thread Dan Paul
So i have a rails app running in 2.0.2 and I would like to know if anyone can point me in the right direction on how to remove the www from the url. so if someone goes to www.mydomain.com it will forward them to mydomain.com. I am running nginx, and thin, not sure if I do it in routes, in my

[Rails] Re: best way to model user or IP

2009-02-23 Thread Daniel Choi
Thanks Sarah. On Feb 23, 12:36 pm, Sarah Mei sarah...@gmail.com wrote: Create a single row in the user table to represent the anonymous user, and associate the IP address with the edit instead of with the user. That way you don't clutter your database with anonymous users but you still

[Rails] Re: How to get cursor / lazy semantics from find(:all)

2009-02-23 Thread Kevin Scaldeferri
Thanks! That's close enough and easy to backport. In principle, a solution that did O(1) queries, rather than O(N) would be nice, but the reduction in memory use at least gets me back to something tolerable. -kevin On Feb 23, 2009, at 12:37 PM, Frederick Cheung wrote: On Feb 23,

[Rails] Re: date filter

2009-02-23 Thread Norm
Dave Smith wrote: Norm wrote: Dave Smith wrote: anyone know any examples of good code for a date range filter i can add to my app to return only selected articles within that range based on their created at date. Here is how I fetch something similar. It is just a

[Rails] Re: rspec dependencies

2009-02-23 Thread Arshak Navruzyan
Robby, Thanks. I had both installed as plugins and switched to gems (after I uninstalled the plugins) but still get that autorun error. Arshak Robby Russell wrote: Try these instructions: http://wiki.github.com/dchelimsky/rspec/rails The cheat for rspec could be out of date.

[Rails] Re: background process

2009-02-23 Thread Norm
Ankit Parekh wrote: thanks for your reply but i dont want to run something like a cron job or nething. Since my method is very long i want it to run in background. So that the user dont need to wait on that page while the process is going on. Is there something where i can define that a

[Rails] Unable to set the replay-to in ActionMailer

2009-02-23 Thread Fernando Perez
Hi, Users can contact me through a form that sends emails through ActionMailer, the problem is that I can't set reply_to, and the from is actually set to my account on the server which sends the email, so I have to copy and paste the user email which is saved in the body in the reply of my mail

[Rails] Re: Joining three objects uniquely using :has_many

2009-02-23 Thread Evan
Andrew, Your last paragraph helps clarify it a little bit. I think you are correct in that I am chasing the wrong thing. I think that stems from not fully understanding the scope option of validates_uniqueness_of. The documentation for it is not clear. Evan On Feb 21, 8:32 pm, Andrew Bloom

[Rails] Re: dynamically changing a form from POST/CREATE to PUT/UPDATE

2009-02-23 Thread groovetrain
Here's the code for the partial that renders the form: http://pastie.org/397999 Here's the rjs that's returned when the above form is submitted and the create first happens, that's supposed to be changing the form from a create to an update (which is IS doing): http://pastie.org/398003 Here's

[Rails] Re: Remove www from url

2009-02-23 Thread Robert Walker
Dan Paul wrote: So i have a rails app running in 2.0.2 and I would like to know if anyone can point me in the right direction on how to remove the www from the url. so if someone goes to www.mydomain.com it will forward them to mydomain.com. I am running nginx, and thin, not sure if I do it

  1   2   >