Re: [Rails] Misleading depreciation warning for form_for

2010-12-07 Thread Colin Law
On 7 December 2010 22:57, Kai Schlamp wrote: > I use form_for to access a serialized instance: > <%= fields_for :settings, @my_model.settings do |settings_form| %> > where "settings" is the serialized instance. This works fine, but I > get the below depreciation. The problem is that when using as

Re: [Rails] Re: missing attribute during initialization

2010-12-07 Thread Colin Law
On 7 December 2010 22:19, Kai Schlamp wrote: > >> I am not fully confident, but here is a suggestion. The call of valid? >> must check for the uniqueness of token.  To do that I think it may be >> doing a find with a condition of the token value of the object being >> validated, so that is the fin

[Rails] Re: Nested categories, nesting has_many :through a HABTM relationship

2010-12-07 Thread Roger
The issue with both each of these posts is that the code will not work in a lot of situations due to one small hole. I was hoping to do this entire thing with a DB, I think I may have now found that way to do this through the post. In either case, the hole with that particular iterator comes from

[Rails] rake aborted! nosuch file to load -- java

2010-12-07 Thread Vamsi Krishna
Hi, When i was migrating the db i got the following error. rake db:migrate rake aborted! no such file to load -- java Can you please let me know what to do to solve this. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "R

[Rails] Re: Can't install Rails 3.0

2010-12-07 Thread Misha Ognev
> Did you have 1.9.1 once upon a time? Yes, I have. > Have you installed any gems since upgrading to 1.9.2? Yes, wxruby ad wxsugar. But I can delete them and reinstalling later, if it need. Walter, what I must to do? > And can you copy and paste as text into your reply, rather than the > scree

[Rails] configuration issue (Uninitialized constant Aftimagr (NameError) )

2010-12-07 Thread Akeel Qureshi
Hello All I am getting this error, any one resolved this. it's urgent ruby script/server --debugger => Booting WEBrick... => Debugger enabled config.gem: Unpacked gem rspec-rails-1.1.11 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. config.gem: Unpacked

Re: [Rails] Re: beginning web development with ror, how?

2010-12-07 Thread Umarzuki Bin Mochlis Moktar
thanks -Original Message- From: Marnen Laibow-Koser Reply-to: rubyonrails-talk@googlegroups.com To: rubyonrails-talk@googlegroups.com Subject: [Rails] Re: beginning web development with ror, how? Date: Tue, 07 Dec 2010 17:35:19 +0100 Umarzuki Bin Mochlis Moktar wrote in post #966803: > H

[Rails] Re: Re: [OT more Ruby maybe] Nested categories, nesting has_many :through a HABTM relationship

2010-12-07 Thread Marnen Laibow-Koser
Rick R wrote in post #967105: > On Tue, Dec 7, 2010 at 11:00 PM, Marnen Laibow-Koser > wrote: > >> >> If it were me, I'd use the nested_has_many_through plugin and have done >> with it. >> > > Interesting. I'll have too look into that. (This initially wasn't my > post > but still curious how to do

Re: [Rails] Re: [OT more Ruby maybe] Nested categories, nesting has_many :through a HABTM relationship

2010-12-07 Thread Rick R
On Tue, Dec 7, 2010 at 11:00 PM, Marnen Laibow-Koser wrote: > > If it were me, I'd use the nested_has_many_through plugin and have done > with it. > Interesting. I'll have too look into that. (This initially wasn't my post but still curious how to do it since I'm sure I'll run into it.) > > You

[Rails] Re: [OT more Ruby maybe] Nested categories, nesting has_many :through a HABTM relationship

2010-12-07 Thread Marnen Laibow-Koser
Rick R wrote in post #967098: > This was posted a while ago, and being new to Ruby/Rails I was curious > how > to tackle it since I'm coming over from verbose Java-land. If you want > you > can just jump to the end where I ask my question (but I left the > original > comments for reference). > > On

[Rails] [OT more Ruby maybe] Nested categories, nesting has_many :through a HABTM relationship

2010-12-07 Thread Rick R
This was posted a while ago, and being new to Ruby/Rails I was curious how to tackle it since I'm coming over from verbose Java-land. If you want you can just jump to the end where I ask my question (but I left the original comments for reference). On Sun, Dec 5, 2010 at 7:13 AM, Colin Law wrote:

[Rails] Re: Where is my db file?

2010-12-07 Thread daze
Wait com'on there must be a way to get this mysql2 database to work quickly with rails server And I've never come across the invalid date error you described. Something...maybe??? On Dec 4, 5:40 pm, Alpha Blue wrote: > I don't recommend using mysql2 gem right now.  It still has many > problem

Re: [Rails] rails with postgresql

2010-12-07 Thread David Kahn
On Tue, Dec 7, 2010 at 7:17 PM, Rajinder Yadav wrote: > On 10-12-07 05:31 PM, David Kahn wrote: > >> >> >> On Tue, Dec 7, 2010 at 4:25 PM, Rajinder Yadav > @gmail.com > wrote: >> >>On Tue, Dec 7, 2010 at 4:59 PM, David Kahn >>mailto:d...@structuralartis

Re: [Rails] rails with postgresql

2010-12-07 Thread Rajinder Yadav
On 10-12-07 05:31 PM, David Kahn wrote: On Tue, Dec 7, 2010 at 4:25 PM, Rajinder Yadav http://devguy.ca>@gmail.com > wrote: On Tue, Dec 7, 2010 at 4:59 PM, David Kahn mailto:d...@structuralartistry.com>> wrote: > > > On Tue, Dec 7, 2010 at 3:49 PM, Raji

[Rails] Re: style question: "update or create" active record

2010-12-07 Thread Fearless Fool
Well, I couldn't rest until I figured out an implementation of create_or_update (see version 1 above) using the oh-so-nifty ActiveRecord::Relation framework. Here it is: class ActiveRecord::Base def self.create_or_update(relation, attrs_to_update) if (incumbent = relation.first).nil?

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread pepe
That probably means that you need a C compiler or DevKit so the install command can build the gem. On Dec 7, 6:27 pm, Rob Th wrote: > Shoot. What the heck is this > > sudo gem install sqlite3-ruby -v 1.2.4 > Password: > Building native extensions.  This could take a while... > ERROR:  Error insta

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
Shoot. What the heck is this sudo gem install sqlite3-ruby -v 1.2.4 Password: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf

[Rails] Re: Advice on data design idea

2010-12-07 Thread E. Litwin
On Dec 7, 1:31 pm, Marnen Laibow-Koser wrote: > Randy Clark wrote in post #967020: > > >>> Really, or would it be better to have an item belong to multiple > >>> categories? Another alternative to consider would be a tagging approach using something like acts-as-taggable-on. (https://github.com/m

[Rails] Misleading depreciation warning for form_for

2010-12-07 Thread Kai Schlamp
I use form_for to access a serialized instance: <%= fields_for :settings, @my_model.settings do |settings_form| %> where "settings" is the serialized instance. This works fine, but I get the below depreciation. The problem is that when using as suggested <%= fields_for @my_model.settings, :as => se

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread pepe
> One remaining glitch. > > "About your application’s environment: > > MissingSourceFile in Rails/infoController#properties > > no such file to load -- sqlite3 > RAILS_ROOT: /Users/rob/hello222 > > Is this a missing sqlite gem? I believe it could be. Try loading the gem and see what happens, you c

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
OK as a famous fictional lawman once said "a man is got to do what a man has got to do", or as we do when a hydro-cylindar pin gets stuck on the back hoe and we break out the big hammer and torch, I just use the wonderful "drag to trash" on all the gem folders I could find, installed sudo gem i

[Rails] Re: Where is my db file?

2010-12-07 Thread daze
Hey thanks! I'll try mysql instead and hope that the server will work better... what a pity that mysql2 isn't so stable. -- 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.c

Re: [Rails] rails with postgresql

2010-12-07 Thread David Kahn
On Tue, Dec 7, 2010 at 4:25 PM, Rajinder Yadav wrote: > On Tue, Dec 7, 2010 at 4:59 PM, David Kahn > wrote: > > > > > > On Tue, Dec 7, 2010 at 3:49 PM, Rajinder Yadav > wrote: > >> > >> Hi this is my first time for a few things. I am trying to get rails > >> working with postgres-9.0.1, I have

Re: [Rails] rails with postgresql

2010-12-07 Thread Rajinder Yadav
On Tue, Dec 7, 2010 at 4:59 PM, David Kahn wrote: > > > On Tue, Dec 7, 2010 at 3:49 PM, Rajinder Yadav wrote: >> >> Hi this is my first time for a few things. I am trying to get rails >> working with postgres-9.0.1, I have never used postgres before. I do >> know the server is listening on localh

Re: [Rails] rails with postgresql

2010-12-07 Thread Rajinder Yadav
On Tue, Dec 7, 2010 at 4:59 PM, Philip Hallstrom wrote: > > > On Dec 7, 2010, at 1:49 PM, Rajinder Yadav wrote: > >> Hi this is my first time for a few things. I am trying to get rails >> working with postgres-9.0.1, I have never used postgres before. I do >> know the server is listening on localh

[Rails] Re: missing attribute during initialization

2010-12-07 Thread Kai Schlamp
> I am not fully confident, but here is a suggestion. The call of valid? > must check for the uniqueness of token.  To do that I think it may be > doing a find with a condition of the token value of the object being > validated, so that is the find_by_sql in the stack.  Since the token > is not un

Re: [Rails] rails with postgresql

2010-12-07 Thread David Kahn
On Tue, Dec 7, 2010 at 3:49 PM, Rajinder Yadav wrote: > Hi this is my first time for a few things. I am trying to get rails > working with postgres-9.0.1, I have never used postgres before. I do > know the server is listening on localhost:5432 as I am able to connect > to it using pgadmin3 and se

Re: [Rails] rails with postgresql

2010-12-07 Thread Philip Hallstrom
On Dec 7, 2010, at 1:49 PM, Rajinder Yadav wrote: > Hi this is my first time for a few things. I am trying to get rails > working with postgres-9.0.1, I have never used postgres before. I do > know the server is listening on localhost:5432 as I am able to connect > to it using pgadmin3 and see t

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread pepe
> Is there a way to run gem in verbose mode to see what is going on? maybe gem (un)install your_gem_here -V? The flag -V (that's the uppercase letter) tells the command to be 'verbose'. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

[Rails] rails with postgresql

2010-12-07 Thread Rajinder Yadav
Hi this is my first time for a few things. I am trying to get rails working with postgres-9.0.1, I have never used postgres before. I do know the server is listening on localhost:5432 as I am able to connect to it using pgadmin3 and see the 2 databases on it. I have 'pg' gem installed my database.

Re: [Rails] Re: Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Colin Law
On 7 December 2010 21:23, Rob Th wrote: > in addition to the gem? [Yn]  y > Removing rails > Successfully uninstalled rails-2.2.2 > RobsiMac:~ rob$ rails -v > -bash: /usr/bin/rails: No such file or directory > RobsiMac:~ rob$ sudo gem install rails -v 2.2.2 > Successfully installed rails-2.2.2 >

[Rails] Re: i created my first helper method and it works, but should this be in a helper, or controller?

2010-12-07 Thread Marnen Laibow-Koser
sol.manager wrote in post #967024: > I am cutting my teeth on Ruby and Rails and am trying to clean up my > views. I just created a helper method that seems to work, but wonder > if a) this should be in helper or controller Logic doesn't go in the controller. > b) is the helper i > created good,

Re: [Rails] PayPal notifications - Rails 3.

2010-12-07 Thread Colin Law
On 7 December 2010 21:03, Anders_P wrote: > Hello! > > I'm trying to integrate PayPal into my (first) Rails app. I've been > looking at RailsCast #142, > http://railscasts.com/episodes/142-paypal-notifications. > But I don't get it to work. My app isn't a normal e-commerce site, > it's a buy and

[Rails] Re: Advice on data design idea

2010-12-07 Thread Marnen Laibow-Koser
Randy Clark wrote in post #967020: >>> Really, or would it be better to have an item belong to multiple >>> categories? > > This is an established use case, already have decided that optionally > belonging to multi-categories will be possible. Plan on doing that > through a habtm relationship with

Re: [Rails] Re: Can't install Rails 3.0

2010-12-07 Thread Walter Lee Davis
On Dec 7, 2010, at 2:41 PM, Misha Ognev wrote: Walter, please see attached. Michael Attachments: http://www.ruby-forum.com/attachment/5526/nnm.gif Here's what strikes me as odd: your ruby is 1.9.2, but your gem paths are in a 1.9.1 hierarchy. Did you have 1.9.1 once upon a time? Have yo

[Rails] i created my first helper method and it works, but should this be in a helper, or controller?

2010-12-07 Thread sol.manager
I am cutting my teeth on Ruby and Rails and am trying to clean up my views. I just created a helper method that seems to work, but wonder if a) this should be in helper or controller b) is the helper i created good, bad, a step in the right direction? The section from the original view: <%= re

[Rails] Re: Jedit + plugin ruby/rails + RVM

2010-12-07 Thread Lily ^_^
Well, it's not exactly the kind of solution I was waiting for. If anyone has a clue about my problem, please don't hesitate. -- 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 grou

[Rails] Re: Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
Hassan Schroeder wrote in post #966986: > On Tue, Dec 7, 2010 at 12:05 PM, Rob Th wrote: > >> RobsiMac:~ rob$ sudo gem uninstall rails >> >> Select gem to uninstall: >> 1. rails-2.2.2 >> 2. rails-2.2.2 >> 3. All versions > >> Ouch. > > So select 3 and keep going :-) > > You can always add back the

[Rails] Re: Advice on data design idea

2010-12-07 Thread Randy Clark
>> Really, or would it be better to have an item belong to multiple >> categories? This is an established use case, already have decided that optionally belonging to multi-categories will be possible. Plan on doing that through a habtm relationship with the products and the categories. >> Go sta

[Rails] Re: Jedit + plugin ruby/rails + RVM

2010-12-07 Thread Marnen Laibow-Koser
Lily ^_^ wrote in post #967015: > I don't know KomodoEdit. I'll take a look if Jedit prooves to not be > enought for me but for the moment, it's the best I found. KomodoEdit is far nicer than jEdit. Check it out! Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted vi

[Rails] Re: Jedit + plugin ruby/rails + RVM

2010-12-07 Thread Marnen Laibow-Koser
Lily ^_^ wrote in post #967015: > I don't know KomodoEdit. I'll take a look if Jedit prooves to not be > enought for me but for the moment, it's the best I found. What's more, a > Google quick search shows some people struggle making rvm and KomodoEdit > work together. Work together how? > And I

[Rails] Re: Use assert_select to test for the occurence of a string

2010-12-07 Thread Marnen Laibow-Koser
Jim Burgess wrote in post #967016: > Oh, right. Thanks a lot. That had been driving me mad (it's an exercise > in a book I'm reading). I changed the test method to: > > def test_should_display_airport_names_in_show > get :show, :id => flights(:dus_muc).id > assert_select 'p', "Departure airport

[Rails] Re: Use assert_select to test for the occurence of a string

2010-12-07 Thread Jim Burgess
Oh, right. Thanks a lot. That had been driving me mad (it's an exercise in a book I'm reading). I changed the test method to: def test_should_show_airport_names_in_show get :show, :id => flights(:dus_muc).id assert_select 'p', "Departure airport:\n DUS" end and it works perfectly. Thanks ag

[Rails] Re: Jedit + plugin ruby/rails + RVM

2010-12-07 Thread Lily ^_^
I don't know KomodoEdit. I'll take a look if Jedit prooves to not be enought for me but for the moment, it's the best I found. What's more, a Google quick search shows some people struggle making rvm and KomodoEdit work together. And I need RVM. The console in the editor is rather a classic isn

[Rails] Re: Caching for layout variables

2010-12-07 Thread Marnen Laibow-Koser
Tim Shaffer wrote in post #967005: > To make a long question short: I'm fairly new to caching in Rails. > What's the best way to cache stuff that is used in the layout without > caching the entire action/view? > > Lets say I have the following in my Application controller to set some > variables th

[Rails] Re: Re: Re: Re: Re: Raw SQL in Migration

2010-12-07 Thread Marnen Laibow-Koser
"Gustavo de Sá Carvalho Honorato" 2010/12/7 Gustavo de S Carvalho Honorato : >>> stuck without any ideas and my deadline is comming :(. >>> >>> I had to do something similar when I patched Foreigner to support MS SQL >>> Server. It was really pretty easy. >> >> Thanks Marnen, I'll try to

Re: [Rails] Re: missing attribute during initialization

2010-12-07 Thread Colin Law
On 7 December 2010 19:24, Kai Schlamp wrote: > Sorry for the late answer ... I had to simplyfy my model somehow to > really test that is not an other interaction that causes that problem. > >> That seems very strange.  Are you absolutely sure that this what is >> happening? >> valid? cannot be fe

[Rails] PayPal notifications - Rails 3.

2010-12-07 Thread Anders_P
Hello! I'm trying to integrate PayPal into my (first) Rails app. I've been looking at RailsCast #142, http://railscasts.com/episodes/142-paypal-notifications. But I don't get it to work. My app isn't a normal e-commerce site, it's a buy and sell site. Every ad has a 'published' boolean, which I w

Re: [Rails] Re: Re: Re: Re: Raw SQL in Migration

2010-12-07 Thread Gustavo de Sá Carvalho Honorato
2010/12/7 Gustavo de Sá Carvalho Honorato : > On Tue, Dec 7, 2010 at 6:49 PM, Marnen Laibow-Koser > wrote: >> "Gustavo de Sá Carvalho Honorato" > #966998: >>> On Tue, Dec 7, 2010 at 6:25 PM, Marnen Laibow-Koser >>> wrote: > > `dump_with_views' > >>> >> /home/gustavo/.rvm/gems/jru

Re: [Rails] Re: Re: Re: Re: Raw SQL in Migration

2010-12-07 Thread Gustavo de Sá Carvalho Honorato
On Tue, Dec 7, 2010 at 6:49 PM, Marnen Laibow-Koser wrote: > "Gustavo de Sá Carvalho Honorato" #966998: >> On Tue, Dec 7, 2010 at 6:25 PM, Marnen Laibow-Koser >> wrote: `dump_with_views' >>> >> > /home/gustavo/.rvm/gems/jruby-1.5.2/gems/activerecord-2.3.8/lib/active_record/schema_

[Rails] Re: Render partial generate unwanted spaces

2010-12-07 Thread bravehoptoad
> Just checking: > UTF-8 without BOM: no problems > UTF-8 with BOM: problems > Right? > Correct. > > I've never seen this problem on *nix.  I wonder if it's an artifact of > Windows' text handling routines. > Yes, I strongly suspect, since the two people who've had this problem are working on Wi

[Rails] Re: Handling File on Upload

2010-12-07 Thread spncrgr
I was finally able to get this to work. I ditched Paperclip and went with putting the code in the controller. Taking it in baby steps, I was able to work out this code for the controller: def upload ((params[:upload][:file]).read).strip.split("\r\n").each do |line| email, account_numbe

[Rails] Caching for layout variables

2010-12-07 Thread Tim Shaffer
To make a long question short: I'm fairly new to caching in Rails. What's the best way to cache stuff that is used in the layout without caching the entire action/view? Lets say I have the following in my Application controller to set some variables that are used in my layout: before_filter :ge

[Rails] Re: Re: Re: Re: Raw SQL in Migration

2010-12-07 Thread Marnen Laibow-Koser
"Gustavo de Sá Carvalho Honorato" On Tue, Dec 7, 2010 at 6:25 PM, Marnen Laibow-Koser > wrote: >>> >>> `dump_with_views' >>> >> > /home/gustavo/.rvm/gems/jruby-1.5.2/gems/activerecord-2.3.8/lib/active_record/schema_dumper.rb:19:in >>> `dump' >>> >>> Do you have any idea? >> >> Probably not a JRu

[Rails] Re: Jedit + plugin ruby/rails + RVM

2010-12-07 Thread Marnen Laibow-Koser
Lily ^_^ wrote in post #966991: > Hi there, > > In my long journey trying to find a comfortable IDE for Ruby on Rails on > Ubuntu, I found this tutorial to set up jedit : > http://www.wikihow.com/Install-Jedit-for-Rails I've switched away from jEdit to KomodoEdit. I highly recommend that you do

Re: [Rails] Use assert_select to test for the occurence of a string

2010-12-07 Thread Colin Law
On 7 December 2010 18:19, Jim Burgess wrote: > Hi, > > How would I use assert select to test for the occurrence of the string > 'DUS' in a 'p' tag about half way down my view? > > I tried: > > def test_should_display_airport_names_in_show >  get :show, :id => flights(:dus_muc).id >  assert_select

[Rails] Re: style question: "update or create" active record

2010-12-07 Thread Marnen Laibow-Koser
Fearless Fool wrote in post #966995: > Marnen Laibow-Koser wrote in post #966963: >> find_or_create_by_* will do exactly this. You can specify additional >> fields for the "create" part of the action. Please see the docs. >> >> If that won't do the trick, then please explain further. > > Hi Marne

Re: [Rails] Re: Re: Re: Raw SQL in Migration

2010-12-07 Thread Gustavo de Sá Carvalho Honorato
On Tue, Dec 7, 2010 at 6:25 PM, Marnen Laibow-Koser wrote: > "Gustavo de Sá Carvalho Honorato" #966984: >> On Tue, Dec 7, 2010 at 4:29 PM, Marnen Laibow-Koser >> wrote: >>> I don't know. I've never used it. But the example sort of implies that >>> you could use AS in the select statement. >> >>

[Rails] Re: Render partial generate unwanted spaces

2010-12-07 Thread Marnen Laibow-Koser
bravehoptoad wrote in post #966994: > Okay, here's what I've got so far: > > If I encode in ANSI or UTF-8 without BOM, I lose my phantom spaces. > > If I encode in plain old UTF-8, phantom spaces with my partials. > > Dunno why... You've got your answer, I guess. It *is* the BOM creating problems

[Rails] Re: style question: "update or create" active record

2010-12-07 Thread Fearless Fool
Marnen Laibow-Koser wrote in post #966963: > find_or_create_by_* will do exactly this. You can specify additional > fields for the "create" part of the action. Please see the docs. > > If that won't do the trick, then please explain further. Hi Marnen: Despite multiple re-reads of the documenta

[Rails] Re: Render partial generate unwanted spaces

2010-12-07 Thread bravehoptoad
Okay, here's what I've got so far: If I encode in ANSI or UTF-8 without BOM, I lose my phantom spaces. If I encode in plain old UTF-8, phantom spaces with my partials. Dunno why...but at least I can use partials again without mucking up my page. One small step for man, I know -- You recei

[Rails] Jedit + plugin ruby/rails + RVM

2010-12-07 Thread Lily ^_^
Hi there, In my long journey trying to find a comfortable IDE for Ruby on Rails on Ubuntu, I found this tutorial to set up jedit : http://www.wikihow.com/Install-Jedit-for-Rails It looks fine for the moment but I have one slight problem with the console plugin : it can't find RVM. Consequently it

[Rails] Re: Re: Re: Raw SQL in Migration

2010-12-07 Thread Marnen Laibow-Koser
"Gustavo de Sá Carvalho Honorato" On Tue, Dec 7, 2010 at 4:29 PM, Marnen Laibow-Koser > wrote: >> I don't know. I've never used it. But the example sort of implies that >> you could use AS in the select statement. > > It seems that rails_sql_view doesn't work with JRuby (I'm using JRuby > and Rai

Re: [Rails] Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Hassan Schroeder
On Tue, Dec 7, 2010 at 12:05 PM, Rob Th wrote: > RobsiMac:~ rob$ sudo gem uninstall rails > > Select gem to uninstall: >  1. rails-2.2.2 >  2. rails-2.2.2 >  3. All versions > Ouch. So select 3 and keep going :-) You can always add back the version you want later. -- Hassan Schroeder ---

Re: [Rails] Re: Re: Raw SQL in Migration

2010-12-07 Thread Gustavo de Sá Carvalho Honorato
On Tue, Dec 7, 2010 at 4:29 PM, Marnen Laibow-Koser wrote: > Please quote when replying. > > "Gustavo de Sá Carvalho Honorato" #966932: >> Thanks Marnen, >> >> I didn't know this plugin. I've read the documentation, but in his >> example I >> can't see how to change the columns names of the view.

[Rails] Re: Advice on data design idea

2010-12-07 Thread Marnen Laibow-Koser
Randy Clark wrote in post #966977: > Thanks Marnen - > >> Er, why? Why does a cargo trailer belong in a boating category? >> I have the impression, here as in your earlier post, that your category >> hierarchy may be in need of some normalization. > > I may need to rethink the data structure, but

[Rails] Re: Advice on data design idea

2010-12-07 Thread Randy Clark
Thanks Marnen - > Er, why? Why does a cargo trailer belong in a boating category? > I have the impression, here as in your earlier post, that your category > hierarchy may be in need of some normalization. I may need to rethink the data structure, but as of now the site calls for categories to b

[Rails] Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
Hassan Schroeder wrote in post #966968: > On Tue, Dec 7, 2010 at 11:39 AM, Rob Th wrote: >> >> RobsiMac:~ rob$ sudo gem install rails -v 2.3.5 >> Successfully installed rails-2.3.5 >> 1 gem installed >> RobsiMac:~ rob$ sudo gem uninstall rails -v 2.3.5 >> Successfully uninstalled rails-2.3.5 >> Ro

[Rails] Re: Render partial generate unwanted spaces

2010-12-07 Thread bravehoptoad
I'm not sure it's the editor; my own issues are coming with Notepad+ +. Still, I'm glad I checked back into this thread. It's given me some stuff to try out. If I find the magic solution (or if I don't) I'll check back in. -- You received this message because you are subscribed to the Google G

[Rails] Re: style question: "update or create" active record

2010-12-07 Thread Fearless Fool
BTW, the best I've come with so far is: file: ar_extensions.rb = class ActiveRecord::Base def self.create_or_update(attrs_to_match, attrs_to_update = {}) if (incumbent = self.first(:conditions => attrs_to_match)) incumbent.update_attributes(attrs_to_update) incum

[Rails] Re: Advice on data design idea

2010-12-07 Thread Marnen Laibow-Koser
Please quote when replying. Randy Clark wrote in post #966962: > Correct I would like to support multiple parents per a given > category. For instance: > > Automotive >> Trailers >>> Cargo Trailer > > Marine/boating >> Misc. >>> Cargo Trailer > > 'Cargo Trailers' may be accessed through differen

Re: [Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Hassan Schroeder
On Tue, Dec 7, 2010 at 11:39 AM, Rob Th wrote: > > RobsiMac:~ rob$ sudo gem install rails -v 2.3.5 > Successfully installed rails-2.3.5 > 1 gem installed > RobsiMac:~ rob$ sudo gem uninstall rails -v 2.3.5 > Successfully uninstalled rails-2.3.5 > RobsiMac:~ rob$ rails -v > Rails 2.3.5 So what hap

Re: [Rails] style question: "update or create" active record

2010-12-07 Thread Philip Hallstrom
On Dec 7, 2010, at 11:34 AM, Fearless Fool wrote: > I find that I'm frequently writing code that could be described in > English as "If there is an incumbent ActiveRecord that meets some > specific criteria, then update one or more of its fields. Otherwise > create a new record with the same cri

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Marnen Laibow-Koser
Rob Th wrote in post #966961: > Even odder. > > sudo gem uninstall rails -v 2.3.5 > ERROR: While executing gem ... (Gem::InstallError) > cannot uninstall, check `gem list -d rails` > RobsiMac:~ rob$ sudo gem install rails -v 2.3.5 > Successfully installed rails-2.3.5 > 1 gem installed > Instal

[Rails] Re: Can't install Rails 3.0

2010-12-07 Thread Misha Ognev
Walter, please see attached. Michael Attachments: http://www.ruby-forum.com/attachment/5526/nnm.gif -- 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 rubyon

[Rails] Re: style question: "update or create" active record

2010-12-07 Thread Marnen Laibow-Koser
Fearless Fool wrote in post #966959: > I find that I'm frequently writing code that could be described in > English as "If there is an incumbent ActiveRecord that meets some > specific criteria, then update one or more of its fields. Otherwise > create a new record with the same criteria and new f

[Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
Even odder. sudo gem uninstall rails -v 2.3.5 ERROR: While executing gem ... (Gem::InstallError) cannot uninstall, check `gem list -d rails` RobsiMac:~ rob$ sudo gem install rails -v 2.3.5 Successfully installed rails-2.3.5 1 gem installed Installing ri documentation for rails-2.3.5... Instal

[Rails] Re: Advice on data design idea

2010-12-07 Thread Randy Clark
Correct I would like to support multiple parents per a given category. For instance: Automotive > Trailers >> Cargo Trailer Marine/boating > Misc. >> Cargo Trailer 'Cargo Trailers' may be accessed through different hierarchies. I have considered using a graph but through the implementation ma

Re: [Rails] Re: Search Fullname, in two fields firstname, lastname.

2010-12-07 Thread Michael Pavling
On 7 December 2010 15:37, Colin Law wrote: > On 7 December 2010 14:04, Srikanth Jeeva wrote: keyword = "Srikanth Jeeva" >> >> Thanks for response. >> After splitting i write query like this, > > Don't forget to include checks to make sure you have two words and > adjust the query accordingly

[Rails] style question: "update or create" active record

2010-12-07 Thread Fearless Fool
I find that I'm frequently writing code that could be described in English as "If there is an incumbent ActiveRecord that meets some specific criteria, then update one or more of its fields. Otherwise create a new record with the same criteria and new field values." ActiveRecord's dynamic finder

[Rails] Re: Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
Hassan Schroeder wrote in post #966954: > On Tue, Dec 7, 2010 at 11:07 AM, Rob Th wrote: > >> I thought uninstalling rails 2.3.8 would uninstall that version then a >> different version would be "current". > > It would have if you'd answered no :-) > >> Looks like several versions of rails are sti

[Rails] style question: "update or create" active record

2010-12-07 Thread Fearless Fool
I find that I'm frequently writing code that could be described in english as "If there is an incumbent ActiveRecord that meets some specific criteria, then update one or more of its fields. Otherwise create a new record with the same criteria and new field values." ActiveRecord's dynamic finder

[Rails] Re: missing attribute during initialization

2010-12-07 Thread Kai Schlamp
Sorry for the late answer ... I had to simplyfy my model somehow to really test that is not an other interaction that causes that problem. > That seems very strange.  Are you absolutely sure that this what is happening? > valid? cannot be fetching the object from the db as it must exist > before y

Re: [Rails] Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Hassan Schroeder
On Tue, Dec 7, 2010 at 11:07 AM, Rob Th wrote: > I thought uninstalling rails 2.3.8 would uninstall that version then a > different version would be "current". It would have if you'd answered no :-) > Looks like several versions of rails are still hanging around! > > But... > > sudo gem uninsta

[Rails] Re: Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Rob Th
Hassan Schroeder wrote in post #966940: > On Tue, Dec 7, 2010 at 10:06 AM, Colin Law > wrote: > >> Correct me if I am wrong but your fundamental problem is that somehow >> the rails environment is messed up. Your proposed solution is to >> delete it all and start again. No-one seems to know how to

Re: [Rails] Can't install Rails 3.0

2010-12-07 Thread Walter Lee Davis
On Dec 7, 2010, at 1:52 PM, Misha Ognev wrote: Hello. I have problem. I can't install rails 3(on windows) If I put "gem install rails" it install 2.2.3 version. If I put "gem update rails" it update 2.2.3 to 2.2.3 version. ruby -v: 1.9.2 What I must do to install rails 3? Could you type

Re: [Rails] Re: Re: Windows new installation - Always problems

2010-12-07 Thread Hassan Schroeder
On Mon, Dec 6, 2010 at 1:36 PM, Marnen Laibow-Koser wrote: > > Oh, that's too bad.  I had the impression (though I've never used it) > that the Glassfish gem in particular was amazing. A correction: the GF gem is no longer being developed by Oracle, but at least one fork is: https://github.co

[Rails] Re: Advice on data design idea

2010-12-07 Thread Marnen Laibow-Koser
Randy Clark wrote in post #966944: > I'm about to embark on a project and am seeking advice on my approach. > I have an automotive site that needs to have shared categories. I've > checked out different nested set, ancestral, acts_as_tree, acyclic > plugins but feel they don't exactly fit. As I s

[Rails] Can't install Rails 3.0

2010-12-07 Thread Misha Ognev
Hello. I have problem. I can't install rails 3(on windows) If I put "gem install rails" it install 2.2.3 version. If I put "gem update rails" it update 2.2.3 to 2.2.3 version. ruby -v: 1.9.2 What I must do to install rails 3? -- Posted via http://www.ruby-forum.com/. -- You received this me

[Rails] Re: I can't start Webrick

2010-12-07 Thread Marnen Laibow-Koser
Please quote when replying. Tara Keane wrote in post #966943: > it's Rails 3.0.3 and that instruction worked. > Thanks a million - back to the books... Not back to the books you've been using. Don't try to learn Rails 3 from a Rails 2 book. A lot changed in version 3. Try http://guides.rubyo

[Rails] Design Question - re: Polymorphic association

2010-12-07 Thread Marnen Laibow-Koser
Randy Clark wrote in post #966805: > Curious about the best direction or design pattern to use here - > looking for opinions. > > I have a store with products diced into categories. Should I create a > polymorphic model 'Product' and have individual models for the product > types? Reason is - the

[Rails] Advice on data design idea

2010-12-07 Thread Randy Clark
I'm about to embark on a project and am seeking advice on my approach. I have an automotive site that needs to have shared categories. I've checked out different nested set, ancestral, acts_as_tree, acyclic plugins but feel they don't exactly fit. So I am about to roll my own simple solution. An

[Rails] Re: I can't start Webrick

2010-12-07 Thread Tara Keane
it's Rails 3.0.3 and that instruction worked. Thanks a million - back to the books... -- 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...@google

[Rails] Re: Design Question - re: Polymorphic association

2010-12-07 Thread Jeff Lewis
Hi Randy, Hard to say for sure without knowing the specific needs/requirements/ demands of your app, but... if your app is a typical biz or ecomm app backed by an rdbms where most of the usage (for end users and for analysis) of the app is spent doing reads vs writes, when it comes to the

[Rails] Re: Re: Raw SQL in Migration

2010-12-07 Thread Marnen Laibow-Koser
Please quote when replying. "Gustavo de Sá Carvalho Honorato" Thanks Marnen, > > I didn't know this plugin. I've read the documentation, but in his > example I > can't see how to change the columns names of the view. Is it possible? I don't know. I've never used it. But the example sort of impl

Re: [Rails] Re: Which RoR to run on Mac OS X for a particular RoR app.

2010-12-07 Thread Hassan Schroeder
On Tue, Dec 7, 2010 at 10:06 AM, Colin Law wrote: > Correct me if I am wrong but your fundamental problem is that somehow > the rails environment is messed up.  Your proposed solution is to > delete it all and start again.  No-one seems to know how to do this, > though you do know how to remove i

Re: [Rails] Re: I can't start Webrick

2010-12-07 Thread Surya
type rails -v in console to check its version. For Rails 3 (latest version) try this command: rails server On Tue, Dec 7, 2010 at 11:47 PM, Tara Keane wrote: > I downloaded the latest version of rails but I don't know how to check > that... > I did create a project already. Then I went into the

[Rails] Use assert_select to test for the occurence of a string

2010-12-07 Thread Jim Burgess
Hi, How would I use assert select to test for the occurrence of the string 'DUS' in a 'p' tag about half way down my view? I tried: def test_should_display_airport_names_in_show get :show, :id => flights(:dus_muc).id assert_select 'p', 'DUS' end but Rails is just finding the first 'p' tag (

[Rails] Re: I can't start Webrick

2010-12-07 Thread Tara Keane
I downloaded the latest version of rails but I don't know how to check that... I did create a project already. Then I went into the main folder and tried to run the server from there but no luck... -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscrib

Re: [Rails] I can't start Webrick

2010-12-07 Thread Irfan Ahmed
hi which version of rails you you are using! -- Thanks, Irfan Ahmed Rizvi (Sagar) cell Numbers: +880 1676 246 991 +880 1723 712 888 http://www.welltreat.us http://restaurant.welltreat.us/ http://isp.welltreat.us/ -- You received this message because you are subscribed to the Google Grou

  1   2   >