Re: [Rails] Ever changing environment... stop it??

2011-04-01 Thread David Kahn
On Fri, Apr 1, 2011 at 6:54 PM, Alex Katebi wrote: > Gemfile.lock > > Yeah, and you will pretty quickly get the hang of it it is a lot less scary IMO than other frameworks. You have Rails 3 with bundler, definitely use RVM (ruby version manager). With these two you should be set. RVM is reall

Re: [Rails] Ever changing environment... stop it??

2011-04-01 Thread Alex Katebi
Gemfile.lock On Fri, Apr 1, 2011 at 8:53 PM, slindsey3000 wrote: > Hi all... relative new guy > > I am a new rails developer but am working as hard as I can to become > competent. > > What are your best practices for locking down an environment to > develop projects in? I want to set up a s

Re: [Rails] Re: require files

2011-04-01 Thread Alex Katebi
This worked too. Even better. Thanks! On Fri, Apr 1, 2011 at 1:57 PM, Frederick Cheung wrote: > > > On Apr 1, 1:38 am, Alex Katebi wrote: > > How to I handle loading files with relative path? > > > > For example: > > > > require '../spec_helper.rb' > > > >require '/home/user/myapp/spec/sp

[Rails] Ever changing environment... stop it??

2011-04-01 Thread slindsey3000
Hi all... relative new guy I am a new rails developer but am working as hard as I can to become competent. What are your best practices for locking down an environment to develop projects in? I want to set up a server and also a local environment then build projects for ... say... 6 months w

Re: [Rails] Re: require files

2011-04-01 Thread Alex Katebi
This worked too. Even better. Thanks! On Fri, Apr 1, 2011 at 1:57 PM, Frederick Cheung wrote: > > > On Apr 1, 1:38 am, Alex Katebi wrote: > > How to I handle loading files with relative path? > > > > For example: > > > > require '../spec_helper.rb' > > > >require '/home/user/myapp/spec/sp

Re: [Rails] Re: require files

2011-04-01 Thread Alex Katebi
Thanks so much! The require_relative is much cleaner. 1.9 works for me. On Fri, Apr 1, 2011 at 12:27 PM, Kendall Gifford wrote: > > This is a commonly used convention: > > # > # Yes, the double "../" are needed if requiring "../spec_helper.rb" this > way > # > require File.expand_path("../../spec

[Rails] Re: "rm public/index.html not recognized...."

2011-04-01 Thread wordmystic
OOps! It's still there, but the rem didn't give me any kind of error message. On Apr 1, 4:54 pm, wordmystic wrote: > But rem worked! > > On Apr 1, 4:43 pm, wordmystic wrote: > > > > > > > > > Actually I took a guess at del and got back:  Invalid switch - > > "index.html". > > > On Apr 1, 3:25 p

[Rails] Re: "rm public/index.html not recognized...."

2011-04-01 Thread wordmystic
But rem worked! On Apr 1, 4:43 pm, wordmystic wrote: > Actually I took a guess at del and got back:  Invalid switch - > "index.html". > > On Apr 1, 3:25 pm, Chris Mear wrote: > > > > > > > > > On 1 Apr 2011, at 22:31, wordmystic wrote: > > > > I typed, "rm public/index.html" > > > > Got back, "'

[Rails] Re: "rm public/index.html not recognized...."

2011-04-01 Thread wordmystic
Actually I took a guess at del and got back: Invalid switch - "index.html". On Apr 1, 3:25 pm, Chris Mear wrote: > On 1 Apr 2011, at 22:31, wordmystic wrote: > > > I typed, "rm public/index.html" > > > Got back, "'rm is not recognized as an internal or external command, > > operable program or b

[Rails] Re: Erubis 2.7.0 release candidate

2011-04-01 Thread makoto kuwata
I released Erubis 2.7.0. Thank you. -- regards, makoto kuwata On March 22, 8:35 pm, makoto kuwata wrote: > Hi all, > > I'll release Erubis 2.7.0 in this week. > I want someone to check whether it works well with Rails 3. > > 2.7.0 gem: >  http://www.kuwata-lab.com/erubis/erubis-2.7.0.gem > 2.7.0

Re: [Rails] "rm public/index.html not recognized...."

2011-04-01 Thread Chris Mear
On 1 Apr 2011, at 22:31, wordmystic wrote: > I typed, "rm public/index.html" > > Got back, "'rm is not recognized as an internal or external command, > operable program or batch file." It sounds like you're on Windows. When you're reading tutorials that have UNIX commands in, you'll need to use

[Rails] {:class=>"pi stuff"} is not a symbol

2011-04-01 Thread John Merlino
Hey all, I'm building a html helper. My view looks like this: = item_view "title", @post.title, :class => 'stuff' My helper looks like this: def format_item_data(data) case data when Class then '' when School then school(data) else data.to_s end.to_s.html_

Re: [Rails] Re: ERROR: Failed to build gem native extension (win server 2003/2008 ruby 1.9.1/1.8.7)

2011-04-01 Thread David Kahn
On Fri, Apr 1, 2011 at 3:43 PM, seeker 7805 wrote: > Hello: > > I am trying to run the hello_world app. I followed instructions here: > gem install mongrel_service --platform i386-mswin32 and the mongrel > service was installed. > > However when I tried to run hello_world>sc-server I received the

[Rails] Re: ERROR: Failed to build gem native extension (win server 2003/2008 ruby 1.9.1/1.8.7)

2011-04-01 Thread seeker 7805
Hello: I am trying to run the hello_world app. I followed instructions here: gem install mongrel_service --platform i386-mswin32 and the mongrel service was installed. However when I tried to run hello_world>sc-server I received the following error: FATAL RubyGem version error: mongrel(1.1.5 n

[Rails] "rm public/index.html not recognized...."

2011-04-01 Thread wordmystic
I typed, "rm public/index.html" Got back, "'rm is not recognized as an internal or external command, operable program or batch file." Bruce -- 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

[Rails] Re: How to validate in this case?

2011-04-01 Thread Frederick Cheung
On Apr 1, 8:59 pm, "Mendel G." wrote: > @Fred > > Yes, that's what I want to do. I'd be tempted to have a non persistent model that contains the set of choices made by the user and write the validations in this model. If you use the ActiveModel stuff for your validations it should be just like

Re: [Rails] Re: How to validate in this case?

2011-04-01 Thread Colin Law
On 1 April 2011 20:59, Mendel G. wrote: > @Fred > > Yes, that's what I want to do. > > @Colin > > That's just an alias for the post. In the model, its real name is > "field_type". That is ok then. When posting questions it is best to stick as closely as possible to the real problem in order to av

[Rails] Re: How to validate in this case?

2011-04-01 Thread Mendel G.
@Fred Yes, that's what I want to do. @Colin That's just an alias for the post. In the model, its real name is "field_type". Thanks, Mendel -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T

Re: [Rails] How to validate in this case?

2011-04-01 Thread Colin Law
On 1 April 2011 19:43, Mendel G. wrote: > My application has the following models: > > Form > Field > FieldForm > Value > Record > > (and others that are irrelevant to the question) > > In a Form, I have many Fields and for a Field, there are many Forms. The > idea is to generate a form with custo

[Rails] Re: rejecting "$ rails new blog"

2011-04-01 Thread elitwin
On Apr 1, 11:20 am, wordmystic wrote: > Newbie here, > > Following this tutorial that says: $ rails new blog. > > I type it into the shell window and get this: '$' is not recognized as > an internal or external command. > > What's up with that? Is this an April Fools joke? -- You received this

[Rails] Re: How to validate in this case?

2011-04-01 Thread Frederick Cheung
On Apr 1, 7:43 pm, "Mendel G." wrote: > > Well... The complicated part comes now. I haven't idea on how to > implement the validation. If the validation is done in the controller, I > don't know how to show the errors that could happen (errors.add_to_base > doesn't work because 'errors' object be

Re: [Rails] How enable LD_LIBRARY_PATH in Capistrano

2011-04-01 Thread Bryan Crossland
On Fri, Apr 1, 2011 at 11:00 AM, rtacconi wrote: > I used to deploy my Rails app using Capistrano. A new server has been > rebuild (Solaris) but now the sys admin does not want to set up > PermitUserEnvironment true and bundle fails. How can I set > LD_LIBRARY_PATH in Capistrano? > Setting the L

[Rails] How to validate in this case?

2011-04-01 Thread Mendel G.
My application has the following models: Form Field FieldForm Value Record (and others that are irrelevant to the question) In a Form, I have many Fields and for a Field, there are many Forms. The idea is to generate a form with customizable Fields. The Field has an attribute called "type" that

Re: [Rails] rejecting "$ rails new blog"

2011-04-01 Thread Walter Lee Davis
It's a convention in many tutorials to show you the dollar sign as an example of your shell prompt. It just means "as a regular user, type this", as opposed to a # prompt, meaning you have to su to root first. Don't type either character if you see them at the beginning of a sample shell co

[Rails] Re: rejecting "$ rails new blog"

2011-04-01 Thread Frederick Cheung
On Apr 1, 7:20 pm, wordmystic wrote: > Newbie here, > > Following this tutorial that says: $ rails new blog. > > I type it into the shell window and get this: '$' is not recognized as > an internal or external command. > > What's up with that? You're not supposed to type the $ - it's just what t

Re: [Rails] rejecting "$ rails new blog"

2011-04-01 Thread Chris Mear
On 1 Apr 2011, at 19:20, wordmystic wrote: > Newbie here, > > Following this tutorial that says: $ rails new blog. > > I type it into the shell window and get this: '$' is not recognized as > an internal or external command. > > What's up with that? The '$' just represents the command prompt t

[Rails] rejecting "$ rails new blog"

2011-04-01 Thread wordmystic
Newbie here, Following this tutorial that says: $ rails new blog. I type it into the shell window and get this: '$' is not recognized as an internal or external command. What's up with that? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g

[Rails] Re: Validates uniqueness of FAILURE Help!

2011-04-01 Thread Frederick Cheung
On Apr 1, 4:46 pm, "Rick F." wrote: > Hi all, > > Running Rails: 2.3.5 > Ruby: 1.8.7p302 > Firebird: 2.1 > > I am running into a weird issue. When connecting to a firebird database > I get the following on any model that uses "validates_uniqueness_of". > Other validations work fine. The unique c

[Rails] Re: require files

2011-04-01 Thread Frederick Cheung
On Apr 1, 1:38 am, Alex Katebi wrote: > How to I handle loading files with relative path? > > For example: > >   require '../spec_helper.rb' > >    require '/home/user/myapp/spec/spec_helper.rb' > assuming this is in the context of rspec, with the current version just require 'spec_helper' will

[Rails] Re: Ruby on Rails for Tablet Computers (Android OS)

2011-04-01 Thread dsadaka
Again, if you like writing in Ruby vs Java, do a sample test app with Mirah. Let us all know how it goes. Thanks, Dan On Mar 31, 4:40 pm, cipher_neo wrote: > I've not heard of Mirah. Certainly like the idea though. > > I have decided to drop the whole rails approach. > > I had designed a rails a

[Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Alexey Muranov
>From my point of view, the most natural way to reestablish the "least surprise" principle would be to 1. implement .insert and .update methods which would simply execute SQL and return it's errors. 2. abandon the .destroyed? method and its @destroyed instance variable 3. switch .persisted? (@pe

[Rails] Re: require files

2011-04-01 Thread Kendall Gifford
This is a commonly used convention: # # Yes, the double "../" are needed if requiring "../spec_helper.rb" this way # require File.expand_path("../../spec_helper.rb", __FILE__) If using ruby 1.9, I know there is #require_relative but I've never really used it yet. -- You received this message

Re: [Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Bryan Crossland
On Fri, Apr 1, 2011 at 10:29 AM, Ramon Leon wrote: > On 04/01/2011 08:05 AM, Bryan Crossland wrote: > >> Except in this case your "record" is an object instance. >> > > Of course. > > > Since an object instance is not a pointer to the actual record in the >> database >> it should not change when

[Rails] How enable LD_LIBRARY_PATH in Capistrano

2011-04-01 Thread rtacconi
I used to deploy my Rails app using Capistrano. A new server has been rebuild (Solaris) but now the sys admin does not want to set up PermitUserEnvironment true and bundle fails. How can I set LD_LIBRARY_PATH in Capistrano? -- You received this message because you are subscribed to the Google Gro

[Rails] Validates uniqueness of FAILURE Help!

2011-04-01 Thread Rick F.
Hi all, Running Rails: 2.3.5 Ruby: 1.8.7p302 Firebird: 2.1 I am running into a weird issue. When connecting to a firebird database I get the following on any model that uses "validates_uniqueness_of". Other validations work fine. The unique check is simply on a name field. I should add this code

[Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Frederick Cheung
On Apr 1, 3:53 pm, Ramon Leon wrote: > On 04/01/2011 03:03 AM, Michael Pavling wrote: > > > So yes, it probably would make more sense to have .save return false > > or raise on saving a destroyed record - but it should raise if you try > > to alter a destroyed record, and it makes not much sense

Re: [Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Ramon Leon
On 04/01/2011 08:05 AM, Bryan Crossland wrote: Except in this case your "record" is an object instance. Of course. Since an object instance is not a pointer to the actual record in the database it should not change when you destroy that record. That doesn't follow. If there is no longer a

[Rails] Re: Commands for work with database

2011-04-01 Thread Manny 777
Thanks Fred, at least I know, what to search... I have that feeling I am solving problems with gems, plugins, interfaces instead programming of apps... Not funny. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on R

Re: [Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Bryan Crossland
On Fri, Apr 1, 2011 at 9:53 AM, Ramon Leon wrote: > On 04/01/2011 03:03 AM, Michael Pavling wrote: > >> So yes, it probably would make more sense to have .save return false >> or raise on saving a destroyed record - but it should raise if you try >> to alter a destroyed record, and it makes not m

Re: [Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Ramon Leon
On 04/01/2011 03:03 AM, Michael Pavling wrote: So yes, it probably would make more sense to have .save return false or raise on saving a destroyed record - but it should raise if you try to alter a destroyed record, and it makes not much sense to save a record you've destroyed and not altered...

[Rails] Re: Commands for work with database

2011-04-01 Thread Frederick Cheung
On Apr 1, 3:21 pm, Manny 777 wrote: > Hello, > >  can someone help, please, how to work with Active Record? > I'm trying under this page > -http://guides.rubyonrails.org/active_record_querying.html#retrieving-... > - building query on database, but I'm getting errors always, when I try > to use

[Rails] Commands for work with database

2011-04-01 Thread Manny 777
Hello, can someone help, please, how to work with Active Record? I'm trying under this page -http://guides.rubyonrails.org/active_record_querying.html#retrieving-a-single-object - building query on database, but I'm getting errors always, when I try to use some command except .new, .save, .find,

[Rails] Re: Errors on installing Rails on windows 7 (32 bit)

2011-04-01 Thread patrick c.
Did you ever get this working? I have the same issue but on Ubuntu 10.10 -- 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. T

[Rails] Designing Rails Application with Run time users plugins

2011-04-01 Thread Manos
Hello, I would like to help me on the following matter I would like to write a rails application and allow users to upload plugins and enable or disable them. I would like to suggest me some designing principles that will allow later the application extension of the application functionality. So

[Rails] Re: Rails + Scaffold + Send Emails

2011-04-01 Thread Frederick Cheung
On Apr 1, 1:29 pm, HelloRails wrote: > Hi! > > I have scaffold named `users` with fields: `email, surname.` > > I inserted about `10 users.` > > Bottom of the scaffold there are button called `"Send"`. > > When i pressed this button email receive all 10 people with following > text => `"Hello! m

Re: [Rails] add_column not working in migration for sqlite3

2011-04-01 Thread Michael Pavling
On 1 April 2011 12:06, Madhusudhan H R wrote: > I developed an app with postgres DB but want to change the DB to > sqlite3. > > "Cannot add a NOT NULL column with default value NULL: ALTER TABLE > "rates" ADD "customer_id" integer NOT NULL". IIRC the same problem cropped up a couple of months bac

Re: [Rails] Re: add_column not working in migration for sqlite3

2011-04-01 Thread Colin Law
On 1 April 2011 12:53, Madhusudhan H R wrote: > Colin Law wrote in post #990365: >> On 1 April 2011 12:06, Madhusudhan H R wrote: >>> Hello, >>> >>> I developed an app with postgres DB but want to change the DB to >>> sqlite3. I changed the database adapter in the database.yml file. When I >>> ru

[Rails] Rails + Scaffold + Send Emails

2011-04-01 Thread HelloRails
Hi! I have scaffold named `users` with fields: `email, surname.` I inserted about `10 users.` Bottom of the scaffold there are button called `"Send"`. When i pressed this button email receive all 10 people with following text => `"Hello! my number is 718927 (this is generated by rand() for

[Rails] Re: How to secure paypal signature, username and password stored in app_config

2011-04-01 Thread Tim Shaffer
If you plan on encrypting it, you'll need to store the encryption key somewhere. Someone who has access to your app_config.yml file would probably also have access to wherever you stored the encryption key. So you probably could encrypt it, but it wouldn't really be solving anything. Why not j

[Rails] Re: print for page

2011-04-01 Thread Tim Shaffer
You will need to use JavaScript or some other client-side library to accomplish that. Neither Ruby nor Rails have the ability to interface with the user's printer from the server-side. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

[Rails] Re: add_column not working in migration for sqlite3

2011-04-01 Thread Madhusudhan H R
Colin Law wrote in post #990365: > On 1 April 2011 12:06, Madhusudhan H R wrote: >> Hello, >> >> I developed an app with postgres DB but want to change the DB to >> sqlite3. I changed the database adapter in the database.yml file. When I >> run the migration most of it was successful but add_colum

[Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Alexey Muranov
Fred, example [1] was meant to be a minimal example. I am more concerned about a situation when the same record is accessed by two applications or through two objects. I said that my question was philosophical (which does not mean that such behavior is not a bug). I understand why SQL executes "su

Re: [Rails] shpinx on RoR

2011-04-01 Thread rajeevsharma86
its sphinx http://freelancing-god.github.com/ts/en/ On Fri, Apr 1, 2011 at 3:19 PM, amit gude wrote: > can ne 1 giv me a nice link to learn hoe to embedd shpinx search > engine on a rails app > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Ta

Re: [Rails] add_column not working in migration for sqlite3

2011-04-01 Thread Colin Law
On 1 April 2011 12:06, Madhusudhan H R wrote: > Hello, > > I developed an app with postgres DB but want to change the DB to > sqlite3. I changed the database adapter in the database.yml file. When I > run the migration most of it was successful but add_column was throwing > an error > > "Cannot ad

[Rails] add_column not working in migration for sqlite3

2011-04-01 Thread Madhusudhan H R
Hello, I developed an app with postgres DB but want to change the DB to sqlite3. I changed the database adapter in the database.yml file. When I run the migration most of it was successful but add_column was throwing an error "Cannot add a NOT NULL column with default value NULL: ALTER TABLE "rat

[Rails] shpinx on RoR

2011-04-01 Thread amit gude
can ne 1 giv me a nice link to learn hoe to embedd shpinx search engine on a rails app -- 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,

Re: [Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Michael Pavling
On 1 April 2011 10:21, Frederick Cheung wrote: >>   UPDATE my_table SET field1 = 'new value' WHERE id = >> >> You'll get a message "no records were updated" - that's a successful >> execution as far as SQL is concerned. > > Although you might expect rails to check the numbers of rows modified > (

[Rails] Re: ActiveRecord: when exactly is a record (model) saved to the database?

2011-04-01 Thread Frederick Cheung
On Apr 1, 6:50 am, Michael Pavling wrote: > On 1 April 2011 01:22, Bryan Crossland wrote: > > > Someone else might know more as to why "save" returns true in this case. If > > not, then it is most likely a bug. > > Try it in your SQL console of choice: > >   UPDATE my_table SET field1 = 'new va

Re: [Rails] Re: How to work with data from DB in controller

2011-04-01 Thread Michael Pavling
On 1 April 2011 08:16, Manny 777 wrote: > No no, I heard you the first time :-/ > the exactly error is "undefined method `sequence' for > nil:NilClass". Now you see, this is where full error messages help. The object you're calling "sequence" on is nil, so something is failing higher up in the

Re: [Rails] Re: How to work with data from DB in controller

2011-04-01 Thread Bryan Crossland
Sorry, missed the nil part. What Colin said below is correct. Try that first. B. Sent from my iPhone On Apr 1, 2011, at 2:24 AM, Colin Law wrote: > On 1 April 2011 08:16, Manny 777 wrote: >> No no, the exactly error is "undefined method `sequence' for >> nil:NilClass". >> >> It looks I am ge

Re: [Rails] Re: How to work with data from DB in controller

2011-04-01 Thread Bryan Crossland
Sent from my iPhone On Apr 1, 2011, at 2:16 AM, Manny 777 wrote: > No no, the exactly error is "undefined method `sequence' for > nil:NilClass". > > It looks I am getting the database object in var "high", but I can't to > get individual items from this object (like "sequence" or "name"). Wh

Re: [Rails] Re: How to work with data from DB in controller

2011-04-01 Thread Colin Law
On 1 April 2011 08:16, Manny 777 wrote: > No no, the exactly error is "undefined method `sequence' for > nil:NilClass". > > It looks I am getting the database object in var "high",  but I can't to > get individual items from this object (like "sequence" or "name"). When > I am trying to print the

[Rails] Browser send optgroup label

2011-04-01 Thread alexey
I have generated with form.fields_for and form.grouped_collection_select the following html (this is just sample): Volvo Saab Mercedes Audi when user submit form, in log i have params[:car][:name] = "Swedish Cars" i did not success to reproduce this issue .. except re

[Rails] Re: How to work with data from DB in controller

2011-04-01 Thread Manny 777
No no, the exactly error is "undefined method `sequence' for nil:NilClass". It looks I am getting the database object in var "high", but I can't to get individual items from this object (like "sequence" or "name"). When I am trying to print the sequence (puts high.sequence), I am getting erro