[Rails] Sql query confusion

2010-01-29 Thread Hemant Bhargava
Hello champs, Scenario is that i have a table called employee and a column for manager_id inside it.. and another table called leaves and having a column employee_id inside it.. I am copying here one record.. Employee table- id employee_name manager_id created_at .. 1 hemant1

[Rails] Beginner

2010-01-29 Thread Chris Bautista
Hello all! I was recommended by a buddy to check out Ruby on Rail. So here I am. Does anyone have any good websites for tutorials? -- 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: RoR hosting help?

2010-01-29 Thread Jarin Udom
Hi, I would use Heroku and store the images on Amazon S3. Jarin Udom Founder, Robot Mode LLC @jarinudom On Jan 28, 12:15 pm, Mike mrh...@gmail.com wrote: Hi, I am looking for suggestions for hosting for a site we're developing in RoR (working with developer): The site allows photographers

[Rails] Re: Generating one page with multiple controllers

2010-01-29 Thread Eddy Josafat
You can use MVC paradigm to your application interface, too. As you describe it, It sounds that is the client side which must handle the logic; well, design it using MVC. This article from A List Apart may be useful: http://www.alistapart.com/articles/javascript-mvc/ On 28 ene, 20:43, Grzegorz

[Rails] Adding div id leading to 500 internal server error in linu

2010-01-29 Thread Kumar Kk
Hi, When i am going to change the div id of an haml page on a linux system leading to 500 error. Example: index.html.haml Original code: #home-main #home-main-left #div-home-step-1 #div-home-step-2 #div-home-step-3 This i am changing to index.html.haml changed one

[Rails] Re: files are missing in rails app

2010-01-29 Thread Geetha Sg
Please let me know where to copy the railties files? -- 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-t...@googlegroups.com. To unsubscribe from

[Rails] errors.add adds is invalid if validation fails

2010-01-29 Thread Karthikeyan
Rails, I have problem. I am validating fields of a class, if validation fails i use the method error.add Say something , but when I test my form by giving a invalid entry, I get error output as Say something is invalid and not as Say something. I really dont know where from this is invalid pops

[Rails] Re: Beginner

2010-01-29 Thread Karthikeyan
goto http://rubyonrails.org , better get Agile Web Development With Rails by Dave Thompson On Jan 29, 12:39 pm, Chris Bautista chrisbautist...@gmail.com wrote: Hello all! I was recommended by a buddy to check out Ruby on Rail. So here I am. Does anyone have any good websites for tutorials?

[Rails] Re: authlogic

2010-01-29 Thread Tom Mac
Hi I partially succeeded in this .But there is also a problem What I did is just add a :active boolean column to users table . Now I can save company ( so user also) without session maintenece. But my requirement is after this just redirect to login page and from there login to pplication by

[Rails] Re: simple captcha image not displaying

2010-01-29 Thread Rails List
Christine, I am the author of Railslist (craigslist clone). Your problem appears to be an issue with ImageMagick/RMagick. You can resolve it either by re-installing them or by verifying that it path is correct. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: RoR hosting help?

2010-01-29 Thread Karthikeyan
I am in India,we don't use credit cards or pay pal, this has made it very difficult to find a ROR hosting wich gives one full 24 hr support. Any one knows a hosting that handles Indian payments? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Give me Suggestion To run ruby file by sciTE in Ubuntu

2010-01-29 Thread Paul OM
I am a newcomer in Ruby. Recently, I am trying to run ruby at Ubuntu. It works well, but the problem occurs when i try to run the program through sciTE at ubuntu. it shows error for 'gets' as below: gets': Bad file descriptor (Errno::EBADF) how can i solve it? -- You received this message

Re: [Rails] Re: files are missing in rails app

2010-01-29 Thread kannav rajeev
rake:freeze:gems On Fri, Jan 29, 2010 at 3:04 PM, Geetha Sg li...@ruby-forum.com wrote: Please let me know where to copy the railties files? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

Re: [Rails] Give me Suggestion To run ruby file by sciTE in Ubuntu

2010-01-29 Thread kannav rajeev
try notepad++ or textmate On Fri, Jan 29, 2010 at 2:45 PM, Paul OM paul.pronabana...@gmail.comwrote: I am a newcomer in Ruby. Recently, I am trying to run ruby at Ubuntu. It works well, but the problem occurs when i try to run the program through sciTE at ubuntu. it shows error for 'gets' as

[Rails] Writing more advanced activerecord error messages

2010-01-29 Thread Rob Aldred
Hi, I want to be able to have a more detailed friendly message for users when they register with an email address thats already taken. At the moment I have written a small validation method to produce what I want, personally I dont like it because I've had to include modules that shouldn't really

Re: [Rails] errors.add adds is invalid if validation fails

2010-01-29 Thread kannav rajeev
tru this and reply: errors.add(:field, 'Say something') errors.add_to_base('Say something') On Fri, Jan 29, 2010 at 3:09 PM, Karthikeyan mindas...@gmail.com wrote: Rails, I have problem. I am validating fields of a class, if validation fails i use the method error.add Say something , but

[Rails] Re: errors.add adds is invalid if validation fails

2010-01-29 Thread Karthikeyan
Thanks Karthikeyan A K 9444018524 On Jan 29, 2:56 pm, kannav rajeev rajeevsharm...@gmail.com wrote: tru this and reply:  errors.add(:field, 'Say something')  errors.add_to_base('Say something') On Fri, Jan 29, 2010 at 3:09 PM, Karthikeyan mindas...@gmail.com wrote: Rails, I have

[Rails] Re: date_select

2010-01-29 Thread Smit Shah
Alexis Mueller wrote: Without knowing more about your app and your models, I would ask what the :post refers to in your date_select. If I understand you correctly, you want to render a date select field for the 'birthdate' attribute. What model does this attribute belong to? Are you using

[Rails] do you want to view only the webpage content that was deliev

2010-01-29 Thread Hamid Raza
How to disable it from code side so that user will not have to go to settings of IE and make it disable. code side solution is required. -- 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

[Rails] Mountable Apps

2010-01-29 Thread Gary Taylor
Hi I am very interested in mountable applications in rails 3. I would like to know if this is an 'engines' replacement as I have a number of engines plugins and I need to know the way forward for converting them either to 'rails 3 engines plugins' (when engines becomes rails 3 compliant) or

Re: [Rails] Re: Beginner

2010-01-29 Thread Colin Law
On 29 January 2010 09:42, Karthikeyan mindas...@gmail.com wrote: goto http://rubyonrails.org , better get Agile Web Development With Rails by Dave Thompson Make sure you get the latest revision of AWD. Also http://www.railstutorial.org/ though this will only take you so far as it is still in

Re: [Rails] Re: Better way to count Active Record Data?

2010-01-29 Thread Rimantas Liubertas
I have it in my head that 1 query to the database is better than 24 to get the data I need for sales each hour of the day. Is that not correct? Sure it is correct in most cases. Hence the GROUP BY in SQL and :group in RoR: Order.count :conditions = [created_at = ? and total between ? and ?,

[Rails] Re: model.errors.add ... No attribute

2010-01-29 Thread Ralph Shnelvar
Ralph Shnelvar wrote: I _think_ that in activerecord-2.2.2\lib\active_record\validations.rb that specifying the attribute as have the nice benefit of just adding the specified message that was supplied. In activerecord-2.3.5\lib\active_record\validations.rb not specifying an attribute

[Rails] text_field instead of a collection_select

2010-01-29 Thread eugenio
one of my model belongs_to another (zip codes). i would like to let the user insert the zip code in a text field instead of the select menu generated by the collection_select. No new zip code should be created and the code should be validated (it should be in the list of valid code). How can this

Re: [Rails] Adding div id leading to 500 internal server error in linu

2010-01-29 Thread Leonardo Mateo
On Fri, Jan 29, 2010 at 6:00 AM, Kumar Kk li...@ruby-forum.com wrote: Hi, When i am going to change the div id of an haml page on a linux system leading to 500 error. Example: index.html.haml Original code: #home-main  #home-main-left    #div-home-step-1    #div-home-step-2    

[Rails] Re: Sql query confusion

2010-01-29 Thread Sharagoz --
Something like Leave.find_by_employee_id(employee_id, :joins = :employee, :conditions = [employees.manager_id=?, manager_id]) -- 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: Writing more advanced activerecord error messages

2010-01-29 Thread keavy
Why not just use validates_uniqueness_of, with a custom :message ? custom-err-msg is handy for custom messages: http://github.com/gumayunov/custom-err-msg I know that doesn't answer your URL issue, but it would seem a simpler/ tidier solution even if you still wanted to include the link. I

[Rails] Re: Generating one page with multiple controllers

2010-01-29 Thread Marnen Laibow-Koser
Grzegorz Lysko wrote: [...] As I understand rails concept is to put the application logic into controllers. Not really. Most of the logic should go in the models. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Writing more advanced activerecord error messages

2010-01-29 Thread Marnen Laibow-Koser
Rob Aldred wrote: Hi, I want to be able to have a more detailed friendly message for users when they register with an email address thats already taken. At the moment I have written a small validation method to produce what I want, personally I dont like it because I've had to include

[Rails] Re: many to many relationship with restful routes

2010-01-29 Thread Aldric Giacomoni
Maulin pa wrote: Here is the scenario, Articles have many Comments Users can write many Comments for many Articles The comments table contains both user_id article_id as foreign keys My models are set up like so class User ActiveRecord::Base has_many :comments has_many

[Rails] Re: Give me Suggestion To run ruby file by sciTE in Ubuntu

2010-01-29 Thread Aldric Giacomoni
Paul OM wrote: I am a newcomer in Ruby. Recently, I am trying to run ruby at Ubuntu. It works well, but the problem occurs when i try to run the program through sciTE at ubuntu. it shows error for 'gets' as below: gets': Bad file descriptor (Errno::EBADF) how can i solve it? Sounds like

[Rails] Re: simple captcha image not displaying

2010-01-29 Thread Christine G.
Rails List wrote: Christine, I am the author of Railslist (craigslist clone). Your problem appears to be an issue with ImageMagick/RMagick. You can resolve it either by re-installing them or by verifying that it path is correct. First of all thank you so much for your response. I love

[Rails] Re: Writing more advanced activerecord error messages

2010-01-29 Thread Rob Aldred
Keavy, Indeed, it would be simpler, but messages with an actions provide a much better way to persuade customers into doing certain actions and in turn providing them with a better experience, rather than them leaving the site because something didn't work. Marnen, I also find myself thinking

[Rails] Re: RoR hosting help?

2010-01-29 Thread Marnen Laibow-Koser
Karthikeyan wrote: I am in India,we don't use credit cards or pay pal, this has made it very difficult to find a ROR hosting wich gives one full 24 hr support. Any one knows a hosting that handles Indian payments? I know PayPal doesn't deal with India...but can't you use credit cards? Best,

[Rails] Re: Sql query confusion

2010-01-29 Thread Hemant Bhargava
Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, :joins = :employee, :conditions = [ employees.manager_id = ?, session[:employee].manager_id ] ) But no

[Rails] Re: Sql query confusion

2010-01-29 Thread Marnen Laibow-Koser
Hemant Bhargava wrote: Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, :joins = :employee, :conditions = [ employees.manager_id = ?,

[Rails] Re: Sql query confusion

2010-01-29 Thread Frederick Cheung
On Jan 29, 2:11 pm, Hemant Bhargava li...@ruby-forum.com wrote: Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, You're passing a symbol which I

[Rails] Re: Sql query confusion

2010-01-29 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote: Hemant Bhargava wrote: Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, :joins = :employee, :conditions = [

[Rails] Re: Writing more advanced activerecord error messages

2010-01-29 Thread Rob Aldred
Although, using a Proc for the :message using that plugin could be an option, ill test it out and see if i can include links in the string returned by the Proc. Thanks again --Rob On Jan 29, 12:07 pm, keavy keavy.mcm...@gmail.com wrote: Why not just use validates_uniqueness_of, with a custom

[Rails] Re: Sql query confusion

2010-01-29 Thread Hemant Bhargava
Marnen Laibow-Koser wrote: Hemant Bhargava wrote: Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, :joins = :employee, :conditions = [

[Rails] Re: Sql query confusion

2010-01-29 Thread Hemant Bhargava
Marnen Laibow-Koser wrote: Marnen Laibow-Koser wrote: Hemant Bhargava wrote: Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, :joins = :employee,

[Rails] remote MSSQL database JDBC URL and driver

2010-01-29 Thread Thufir
Right now I'm connecting to a remote MSSQL db using sqljdbc4.jar from Netbeans, which works fine for Java. However, for Ruby (not Jruby, note), what's best? Would this adapter work: http://github.com/rails-sqlserver/2000-2005-adapter I ask because the MSSQL db expects a JDBC connection, I

[Rails] Re: install gems problem in windows

2010-01-29 Thread Bob
I believe in windows it's gem update --system not sure if this is required in *nix, but I've always had to add the -- in windows. Hope this helps... On Jan 29, 1:55 am, kannav rajeev rajeevsharm...@gmail.com wrote: install ruby gem update gem update system ruby -v gem install rails rails

[Rails] Re: Sql query confusion

2010-01-29 Thread Marnen Laibow-Koser
Hemant Bhargava wrote: Marnen Laibow-Koser wrote: Hemant Bhargava wrote: Hi Sharagoz, This query is not working.. My model names are Leaves and Employee and table names are leaves and employees. So i tried this query as:- Leaves.find_by_employee_id (:employee_id, :joins = :employee,

[Rails] Re: Writing more advanced activerecord error messages

2010-01-29 Thread Marnen Laibow-Koser
Rob Aldred wrote: Although, using a Proc for the :message using that plugin could be an option, ill test it out and see if i can include links in the string returned by the Proc. I don't see why not. It's just a string. Thanks again --Rob Best, -- Marnen Laibow-Koser

[Rails] Re: Re: What is the purpose of :conditions on a belongs_to

2010-01-29 Thread Robert Walker
Dave Sims wrote: If you know of documentation in addition to the api docs linked from my original post which might be helpful, feel free to include a link. As mentioned, the API doc actually does explain this relatively clearly in this statement: :conditions Specify the conditions that the

[Rails] Re: many to many relationship with restful routes

2010-01-29 Thread Maulin
Haha! The beard bit made me laugh :) Well, in my model articles dont have a user association. They just have comments and users can post comments to different articles So basically article and user have a many to many relationship with the comments being the join table (it contains both

[Rails] Re: many to many relationship with restful routes

2010-01-29 Thread Aldric Giacomoni
Maulin pa wrote: Well, in my model articles dont have a user association. They just have comments and users can post comments to different articles Okay, so we have: Article has many comments Comment belongs to article Comment belongs to user User has many comments So basically article

[Rails] Re: many to many relationship with restful routes

2010-01-29 Thread Maulin
*blink* Yes, but no. I mean.. Yes, but no! You're abusing the concept of the many:many relationship. As long as you're aware of that, let's move on... Since the comments table has both the article and user id's it just lends itself to be thought of that way, dont you think? What else would you

[Rails] Rails 3 App generator - could not find source path

2010-01-29 Thread Kristian
Could not find README in source paths. module Nifty module Generators class AppGenerator Base def self.source_root @source_root ||= File.expand_path(File.join(File.dirname (__FILE__), 'templates')) end def initialize(*args) super end def

[Rails] Re: attr_accessible question

2010-01-29 Thread byrnejb
On Jan 28, 6:28 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: is there some simple way to later add :d Model.attr_accessible :d or remove :c? I'm not sure. So is attr_accessible is a one-way trip? Is is the case that once an attribute is added to the attr_accessible collection

[Rails] Re: many to many relationship with restful routes

2010-01-29 Thread Aldric Giacomoni
Maulin pa wrote: The user_article_comment_path([...@user, @article]) will point to the new action in the comment controller and rails knows to use user_id and article_id from the [...@user, @article] In other words, you want to create a new many-to-many relationship ? Your problem is that

Re: [Rails] Re: authlogic

2010-01-29 Thread Craig White
On Fri, 2010-01-29 at 10:44 +0100, Tom Mac wrote: Hi I partially succeeded in this .But there is also a problem What I did is just add a :active boolean column to users table . Now I can save company ( so user also) without session maintenece. But my requirement is after this just

[Rails] syntax error, unexpected keyword_ensure, expecting $end

2010-01-29 Thread Vishwa Rao
I call a test method on posting data to a signup form def test_bad_signup u = User.new post :signup, :user = { :login = newbob, :password = newpassword, :password_confirmation = wrong , :email = new...@mcbob.com} assert_response :success assert !u.valid? assert

Re: [Rails][SOLVED] observe_field and IE 8

2010-01-29 Thread Craig White
On Thu, 2010-01-28 at 22:11 -0700, Craig White wrote: I want to blame IE 8 because I designed with FF and did not see any issue but IE 8 definitely is a problem. To simplify a fairly complex page... LAYOUT.HTML.ERB div id=container % yield % LIST.HTML.ERB div id=content_area %=

[Rails] Re: syntax error, unexpected keyword_ensure, expecting $end

2010-01-29 Thread Frederick Cheung
On Jan 29, 4:44 pm, Vishwa Rao li...@ruby-forum.com wrote: Here is the signup.html.erb %= form_tag :action= signup % this should be % form_tag :action= signup do % as it currently is you have an % end % at the bottom of your view but nothing that starts the block. Fred %=

Re: [Rails] syntax error, unexpected keyword_ensure, expecting $end

2010-01-29 Thread Colin Law
On 29 January 2010 16:44, Vishwa Rao li...@ruby-forum.com wrote: I call a test method on posting data to a signup form def test_bad_signup    u = User.new    post :signup, :user = { :login = newbob, :password = newpassword, :password_confirmation = wrong , :email = new...@mcbob.com}    

[Rails] Re: do you want to view only the webpage content that was de

2010-01-29 Thread Robert Walker
Hamid Raza wrote: How to disable it from code side so that user will not have to go to settings of IE and make it disable. code side solution is required. What would be the point to a client configurable security setting that the server or JavaScript could change? -- Posted via

Re: [Rails] Re: Sql query confusion

2010-01-29 Thread Niels Meersschaert
Part of the issue may also be that your model/table names are NOT following convention. The model should be singular, the table name plural underscored lower case: Model Table Leave leaves Employeeemployees Assume you also have these in your classes: class Leave

[Rails] Re: Super noob needs help.

2010-01-29 Thread Afg Afg
Marnen Laibow-Koser wrote: Sean Six wrote: Is the tutorial telling you to put that code in the AdminController? It is my guess that the code is based on a plugin or gem. Have you included all the proper plugins and gems? Scaffold (in the controller) used to be part of Rails. It was

[Rails] Rails app on EC2

2010-01-29 Thread Jamal Soueidan
Hello, I'm thinking to move my app to ec2, but Im reading that amazon does not guarantee that my instance doesn't die? So my question how can people use it for rails, and what does they do when the amazon ec2 instance dies? Do we have any automatic job to get new instance and get the app up and

[Rails] Re: Best Practices; Deploying Updates

2010-01-29 Thread Dan Paul
Wow, thanks for all the replies I greatly appreciate it. Looks like I got some reading to do, I have found some capistrano scripts that seem pretty promising. And unicorn also seems really cool, github is using them and I just read their article on how they use it and why it is better.

Re: [Rails] Re: Super noob needs help.

2010-01-29 Thread Ethan Gunderson
Can you not install the plugin for some reason? Alternatively, you could always install the version of rails that he is using, which must be a pre 2.0 rails. On Fri, Jan 29, 2010 at 12:14 PM, Afg Afg li...@ruby-forum.com wrote: Marnen Laibow-Koser wrote: Sean Six wrote: Is the tutorial

[Rails] Re: syntax error, unexpected keyword_ensure, expecting $end

2010-01-29 Thread Vishwa Rao
Fred, Colin Thank you very much. I am learning rails very slowly I corrected the signup.html.erb h1Signup/h1 % form_tag :action= 'signup' do % %= error_messages_for 'user' % br/ h3Signup/h3 label for=user_loginUsername/labelbr/ %= text_field user, login, :size = 20 %br/ label

Re: [Rails] Rails app on EC2

2010-01-29 Thread Conrad Taylor
On Fri, Jan 29, 2010 at 1:12 PM, Jamal Soueidan li...@ruby-forum.comwrote: Hello, I'm thinking to move my app to ec2, but Im reading that amazon does not guarantee that my instance doesn't die? So my question how can people use it for rails, and what does they do when the amazon ec2

[Rails] script/generate forum

2010-01-29 Thread Al Eph
Hi, we can generate Model, Controller, Mailers... does anyone know of a generator for a forum? if anyone wants to develop one please get in touch, a...@live.it -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

RE: [Rails] Re: RoR hosting help?

2010-01-29 Thread Joel Dezenzio
Check for a hosting site that accepts mobile payments through Boku or Paymo. If you have a cell phone, the charges are added to the text rates and you just make payments normally through your cell phone provider. Sincerely, Joel Dezenzio Website Bio: http://jdezenzio.com/ Rails Production

[Rails] Re: Re: Super noob needs help.

2010-01-29 Thread Marnen Laibow-Koser
Ethan Gunderson wrote: Can you not install the plugin for some reason? Bad idea. Scaffolding is best avoided. Alternatively, you could always install the version of rails that he is using, which must be a pre 2.0 rails. No, please don't do that. Learn the current version of Rails. The

[Rails] Re: install gems problem in windows

2010-01-29 Thread Cristian Vasquez
Bob wrote: I believe in windows it's gem update --system not sure if this is required in *nix, but I've always had to add the -- in windows. Hope this helps... Hi, I have some problems with that in Windows xp to, but after looking around in the web the simpliest solution is: 1.

[Rails] Memory, memory, memory

2010-01-29 Thread PierreW
Hi guys, I am currently hunting leaks in my app, and either I don't quite understand how ruby/rails handle memory, or there are some features of Rails I am not aware of. And indeed, I found - for example - this comment on this group (from Ezra): You are going to see massive memory usage like

[Rails] requiring records in the DB before testing

2010-01-29 Thread kkohrt
Is there any way I can require a small set of data be in the test database before any tests are run? (unit, functional, integration, cucumber, etc) Any way besides using fixtures, that is. Overload a rake task? Modify test_helper? Any ideas? (Simple Case: I have to have a minimal set of user roles

[Rails] Re: Memory, memory, memory

2010-01-29 Thread Aldric Giacomoni
PierreW wrote: Hi guys, I am currently hunting leaks in my app, and either I don't quite understand how ruby/rails handle memory, or there are some features of Rails I am not aware of. And indeed, I found - for example - this comment on this group (from Ezra): Thanks! Pierre The way

Re: [Rails] Re: Re: Super noob needs help.

2010-01-29 Thread Ethan Gunderson
I entirely agree, and we've all recommended the same, but he seems pretty set on using these certain tutorials :) On Fri, Jan 29, 2010 at 2:02 PM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Ethan Gunderson wrote: Can you not install the plugin for some reason? Bad idea. Scaffolding is

[Rails] Re: requiring records in the DB before testing

2010-01-29 Thread E. Litwin
Look at rake db:seed as one alternative. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Oh no! I have a Spec model

2010-01-29 Thread Vincent P
Marnen! Thank you so much for motivating me to use Cucumber. It makes functional and integration testing so easy! Vincent. On Jan 27, 12:15 am, Ease Bus ease...@gmail.com wrote: Thanks Marnen! I will surely look into back references next time.  Before I got your answer, I managed to do

[Rails] How to create Rails 3 migration generator?

2010-01-29 Thread szimek
Hi, I'd like to add Rails 3 compatible generator to acts_as_taggable_on gem (all it does is call migration_template method) and got a problem with next_migration_number method not being implemented. For ActiveRecord this method is defined in ActiveRecord::Generators::Base class, which inherits

[Rails] want to combine two searches into one

2010-01-29 Thread Sean Six
I would like to merge this method from a controller into a separate model, called search. class DudesController ApplicationController def search @address = params[:address] @within = params[:within] @dudes = Restaurant.find :all, :origin = @address,

Re: [Rails] requiring records in the DB before testing

2010-01-29 Thread steve ross
On Jan 29, 2010, at 11:22 AM, kkohrt wrote: Is there any way I can require a small set of data be in the test database before any tests are run? (unit, functional, integration, cucumber, etc) Any way besides using fixtures, that is. Overload a rake task? Modify test_helper? Any ideas?

Re: [Rails] text_field instead of a collection_select

2010-01-29 Thread Philip Hallstrom
one of my model belongs_to another (zip codes). i would like to let the user insert the zip code in a text field instead of the select menu generated by the collection_select. No new zip code should be created and the code should be validated (it should be in the list of valid code). How can this

[Rails] rails console not loading my model properly.

2010-01-29 Thread junkone1
You can see below that when i load the console, it is not loading my model Comparetick. however after i perform a manual require, it is loading it correctly. i am not sure where to look for the issue. E:\TradingTools\Developmentruby script\console ./script/../config/boot.rb:20:Warning:

[Rails] Re: simple captcha image not displaying

2010-01-29 Thread Christine G.
YAY! So I got the captcha working on my own. For information's sake here's how I had to fix the problem. I went here: http://corefonts.sourceforge.net/ and installed the fonts. It stuck them in /usr/share/fonts/msttcorefonts but the default path is not there so I so I just copied the fonts

Re: [Rails] Re: RoR hosting help?

2010-01-29 Thread Jason Soo
+1 vote for Heroku and Slicehost. I've used both and love both. However, I use Slicehost for non-rails apps, and Heroku for my rails apps. --- Jason Soo I'm going to live forever or die trying. On Fri, Jan 29, 2010 at 1:59 PM, Joel Dezenzio jdezen...@gmail.com wrote: Check for a hosting site

[Rails] Re: Rails 3 App generator - could not find source path

2010-01-29 Thread Kristian
Works with this in my Rakefile :) gem.files=FileList['lib/**/*', 'bin/*'] -- 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-t...@googlegroups.com. To unsubscribe from this group, send

[Rails] Re: Re: RoR hosting help?

2010-01-29 Thread Marnen Laibow-Koser
Jason Soo wrote: +1 vote for Heroku and Slicehost. I've used both and love both. However, I use Slicehost for non-rails apps, and Heroku for my rails apps. Right. I use Slicehost for the Rails apps I've written that need things Heroku can't provide. --- Jason Soo I'm going to live

[Rails] Re: requiring records in the DB before testing

2010-01-29 Thread Marnen Laibow-Koser
Steve Ross wrote: On Jan 29, 2010, at 11:22 AM, kkohrt wrote: Is there any way I can require a small set of data be in the test database before any tests are run? (unit, functional, integration, cucumber, etc) Any way besides using fixtures, that is. Overload a rake task? Modify

[Rails] Re: Oh no! I have a Spec model

2010-01-29 Thread Marnen Laibow-Koser
Learn by Doing wrote: Marnen! Thank you so much for motivating me to use Cucumber. It makes functional and integration testing so easy! You're most welcome. It's amazing, isn't it? Vincent. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via

[Rails] Re: How to create Rails 3 migration generator?

2010-01-29 Thread Kristian
If you look at the scaffold generator, it is able to apply the correct model/migration generator depending on the orm setting in application.rb. This is handled transparently as I see it. It simply calls the correct migration and model generators with a name corresponding to the orm setting. Check

[Rails] Re: script/generate forum

2010-01-29 Thread Marnen Laibow-Koser
Al Eph wrote: Hi, we can generate Model, Controller, Mailers... does anyone know of a generator for a forum? No, and that's too complex for a generator to work well. There are various forum packages for Rails -- a Web search should uncover some. if anyone wants to develop one please get

[Rails] ROR Forms Help

2010-01-29 Thread Ashwin Vel
Okay this is what i have now . just testing out something, So i just have a Form which has 2 fields , Name and Value I am not using any databases, So when i hit the Submit button , i should see the Name , Value pair on the screen. I am pretty new to Rails, so any help / suggestions would be

Re: [Rails] rails console not loading my model properly.

2010-01-29 Thread Hassan Schroeder
On Fri, Jan 29, 2010 at 2:09 PM, junkone1 junko...@gmail.com wrote: You can see below that when i load the console, it is not loading my model Comparetick. however after i perform a manual require, it is loading it correctly. i am not sure where to look for the issue. Dir.glob(RAILS_ROOT +

[Rails] Saving to the DB uses a lot of RAM?

2010-01-29 Thread PierreW
Hi guys, I must be missing something obvious... array_of_stuff = [ contains a lot of fairly small AR objects ] # RAM at 30MB array_of_stuff.each do |foo| foo.save end array_of_stuff = nil # RAM at 60+MB The iteration itself takes 30+MB of RAM (I measure with memory_usage from #{pcaller}

[Rails] Best way to do this

2010-01-29 Thread Steve Castaneda
I'm looking to give an object (buyer) a status. What's the best way to accomplish this? At the moment, I'm struggling to comprehend my way through the following: 1) Create a status model, then let the user add statuses as they see fit. These statuses can then be applied to a buyer. The buyer

[Rails] Re: Best way to do this

2010-01-29 Thread Steve Castaneda
I'm beginning to think there needs to be a third table; one whose columns are: id, buyer_id, status_id This would be my first time doing it like this though, so I sort of get stuck understanding how the route is supposed to work. -- Posted via http://www.ruby-forum.com/. -- You received

Re: [Rails] Best way to do this

2010-01-29 Thread Jamey Cribbs
Sounds like you do not have your associations defined correctly in your model. In your Buyer model you should have this line: belongs_to :status In your Status model you should have this line: has_many :buyers HTH, Jamey On Fri, Jan 29, 2010 at 9:11 PM, Steve Castaneda

[Rails] Re: Re: files are missing in rails app

2010-01-29 Thread Geetha Sg
i am new to rails.. sorry.. i dont understand that where should run this rake task? please help 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 group, send email to

[Rails] Re: Re: authlogic

2010-01-29 Thread Tom Mac
Hi Thanks for your reply. My model code is class User ActiveRecord::Base acts_as_authentic belongs_to :company end class Company ActiveRecord::Base has_many :users accepts_nested_attributes_for :users end My companies controller is def new @company = Company.new

[Rails] Re: Best way to do this

2010-01-29 Thread Steve Castaneda
Jamey Cribbs wrote: Sounds like you do not have your associations defined correctly in your model. In your Buyer model you should have this line: belongs_to :status In your Status model you should have this line: has_many :buyers HTH, Jamey That was it! Thank you

[Rails] amazon s3 rails file download issue

2010-01-29 Thread Me
I am trying to get a file from the amazon bucket but it says string contains null byte. any idea how to get the file to download like a regular file? The file is there at the location. f = Heypub.value @bucket send_file( f , :type = FileExtns[ext]['mime'], :disposition = 'attachment') -- You

[Rails] Are class variables session specific?

2010-01-29 Thread Ralph Shnelvar
I'm trying to wrap my head around what information is session specific and what isn't. If I do User::x = 1 will User::x == 1 for all sessions on the same machine? I think it is the same on the same, but I'd like confirmation. -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Rails app on EC2

2010-01-29 Thread Jamal Soueidan
Thanks for your reply :) Well as I understand when instance dies you could lose your static ip and you can lose all your data on the instance? So I also need to find another service to host the database. But I understand that all those type of issues can be fixed by using Rightscale or maybe

  1   2   >