[Rails] Re: Paypal issue

2009-10-07 Thread Saurabh Peshkar
Hi All, Modifying the above query, I want to make mass payment in paypal using rails, can i integrate paypal for mass payment. Thanks Saurabh -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[Rails] Paypal issue

2009-10-07 Thread Saurabh Peshkar
Hi All, I'm using paypal for transaction in my site, it is working properly for the scenario of sending money from one person to another person but if I want to send money from one person to multiple persons with multiple amounts using paypal and rails how can I achieve it?? Thanks in advance,

[Rails] Re: Removing extranious html

2009-10-07 Thread Morgan Morgan
Marnen Laibow-Koser wrote: > > Your regex book will be the best help, but here's a clue: I think you're > going about it inside-out. It would probably easiest to extract the > entire element. It's relatively simple to write a regex that > will cover most cases, but if you have to cover abso

[Rails] Re: Removing extranious html

2009-10-07 Thread Marnen Laibow-Koser
Morgan Morgan wrote: > I can't seem to find a way to do this.. i have a bunch of html files > that i just need to remove from the tag on the > top then i need to remove from to on the bottom. > > i looked at gsub and i'm learning regular expressions but i can't seem > to figure out how they w

[Rails] Removing extranious html

2009-10-07 Thread Morgan Morgan
I can't seem to find a way to do this.. i have a bunch of html files that i just need to remove from the tag on the top then i need to remove from to on the bottom. i looked at gsub and i'm learning regular expressions but i can't seem to figure out how they work. so far i've been able to fi

[Rails] sorry for the spam

2009-10-07 Thread Michael Steinfeld
So it seems this account was cracked/hacked. Some of you may have received some bullshit email about buying a TV. Please ignore that message as it was sent from whoever hacked this account. It's already been rectified. I apologize for the inconvenience.. damn hackers. for those that care the sen

[Rails] Re: Best way to share a plugin between different Rails application

2009-10-07 Thread Philip Hallstrom
> What I still don't know is how to share this plugin among the apps. > I see > two ways: > > 1) As a git submodule. So, the plugin would be in vendor/plugins, > but as a > git submodule; > 2) In a central location, still version-controlled of course, but the > sharing wouldn't be done via git

[Rails] Best way to share a plugin between different Rails application

2009-10-07 Thread Marcelo de Moraes Serpa
Hello list, Ok, so this issue might be a topic for a design pattern that has already been discussed a lot around the Rails community, but the information I found is too disperse, and I would like some specific advice if possible. I have a project that consists of several Rails applications. Actua

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Aaron Turner wrote: > On Wed, Oct 7, 2009 at 2:43 PM, Greg Donald wrote: >> doesn't do something when it has had the capability for more than 5 >> years. �PostgreSQL is a fine database (I've been using it forever too) >> but loving it doesn't doesn't give you the right to spread lies about >> MyS

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Aaron Turner
On Wed, Oct 7, 2009 at 2:43 PM, Greg Donald wrote: > > On Wed, Oct 7, 2009 at 4:26 PM, Rob Saul wrote: >>> That's fine.  But don't start bashing MySQL thinking you know >>> something about it when clearly you don't. >> >> that's something of a leap. Just because someone doesn't know >> about a p

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Greg Donald wrote: > On Wed, Oct 7, 2009 at 4:26 PM, Rob Saul wrote: >>> That's fine. �But don't start bashing MySQL thinking you know >>> something about it when clearly you don't. >> >> that's something of a leap. Just because someone doesn't know >> about a particular feature of MySQL does not

[Rails] Re: constant ActionView::Base::Subclasses::MainController not defined

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 4:42 PM, Joshua Partogi wrote: > I checked-out the latest from github. Anyway, I've found the problem. > There's still unfinished code in actionview. I'll live with that for > the time being. That's what I was thinking you might say. You will probably get more responses t

[Rails] Re: Rails and SQLITE

2009-10-07 Thread Lee Smith
Don't forget the sqlite manager plugin for Firefox...it pretty much rocks. https://addons.mozilla.org/en-US/firefox/addon/5817 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to t

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 4:26 PM, Rob Saul wrote: >> That's fine.  But don't start bashing MySQL thinking you know >> something about it when clearly you don't. > > that's something of a leap. Just because someone doesn't know > about a particular feature of MySQL does not negate them > knowing "so

[Rails] Re: constant ActionView::Base::Subclasses::MainController not defined

2009-10-07 Thread Joshua Partogi
On Oct 8, 12:52 am, Greg Donald wrote: > On Wed, Oct 7, 2009 at 8:11 AM, Joshua Partogi > wrote: > > Today I've just checked-out Rails version 3 > > Where did you get this "version 3" ? As far as I know it's not been released. Greg, I checked-out the latest from github. Anyway, I've found th

[Rails] RESTful XML requests, how to?

2009-10-07 Thread Victor Martin
Hi there, I'm reading a lot of REST for adding web services to my web app, but I'm pretty newbie to all this an I have some doubts. I need my app to admit xml requests, but all I have read about REST it gets just strings in a URL. Is there any way to make it get XML files? I guess there is a way,

[Rails] Re: Using AJAX to generate complex forms interactively - any guides?

2009-10-07 Thread ct9a
thank you. Just had a look at it. Whenever you load data into objects in the controller (which gets received by the view), how do you stop the first element from being selected by default when you load the page? In relation to the example in http://pullmonkey.com/2008/3/30/dynamic-select-boxes-

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Rob Saul
Greg Donald wrote: > On Wed, Oct 7, 2009 at 1:06 PM, Marnen Laibow-Koser > wrote: >> Yes, you found an obscure setting > > Obscure? It's right there in the documentation! Jesus Christ man, > it's not like I went digging on some mailing list from 1997 to find > it. > > I mean really, does this

[Rails] Nested form

2009-10-07 Thread Dj t...@l
Hello, I've got a problem with the creation of a nested form for this situation I've got 3 models as follow Game -> has_many :authorships Authorship -> belong_to :author -> belong_to :game Author > belong_to :authorship In my form the user can enter the author name when creating a new game.

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 1:06 PM, Marnen Laibow-Koser wrote: > Yes, you found an obscure setting Obscure? It's right there in the documentation! Jesus Christ man, it's not like I went digging on some mailing list from 1997 to find it. I mean really, does this page/url look obscure? http://dev.

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 12:52 PM, Marnen Laibow-Koser wrote: > Their feature sets > are not comparable.  They cannot be used comparably in my experience. That's like saying you don't drive red cars very much so it's impossible to compare red cars and blue cars. -- Greg Donald http://destiney.c

[Rails] Re: Problems installing ruby gems on linux

2009-10-07 Thread Craig White
On Wed, 2009-10-07 at 13:47 -0700, mpcengineer wrote: > Thanks Craig, > > tried sudo su - > > Unfotunatly still get the same error. > > I find it difficult to see what is going wrong. I can only think its > something to do library paths. > > > There is a defaults.rb in the rubygems directory

[Rails] Re: Problems installing ruby gems on linux

2009-10-07 Thread mpcengineer
Thanks Craig, tried sudo su - Unfotunatly still get the same error. I find it difficult to see what is going wrong. I can only think its something to do library paths. There is a defaults.rb in the rubygems directory. It seems the setup.rb script can not see it Any experts out there.

[Rails] Re: Return "title" column if "caption" column is empty?

2009-10-07 Thread Joshua Muheim
Thanks for your useful hints, guys. :-) -- 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@go

[Rails] Re: How to display results from 2 views.........

2009-10-07 Thread Colin Law
2009/10/7 Aldric Giacomoni : > > Avnish Malik wrote: >> Plz Help >> [...] I need to display both the data on the same page [...] > > Time to make two partials. > google search : rails partials You will need a new action in one of your controllers, or more likely a new controller, that picks u

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Tom Tom
ok, this is a function, sitting on my model: category.rb ## A ) ## def full_xml(builder=nil) to_xml(:builder => builder, :skip_instruct => true) do |xml| children.each { |child| child.full_xml(xml) } end

[Rails] During upgrade, schema_migrations table not populated

2009-10-07 Thread Terri I.
We upgraded our app from Rails 1.2 to 2.3. There were no outstanding database migrations, i.e. the database was up-to-date during the upgrade/deployment process. The schema_migrations table was created, but it was not populated and the schema_info table was not removed. Can anyone explain why t

[Rails] Re: How to display results from 2 views.........

2009-10-07 Thread Aldric Giacomoni
Avnish Malik wrote: > Plz Help > [...] I need to display both the data on the same page [...] Time to make two partials. google search : rails partials -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are s

[Rails] Re: routes: _path vs. _url

2009-10-07 Thread Philip Hallstrom
> Routes offers you the ability to use _path or _url as a way to make > links/redirect/etc throughout your site. However, I'm just wondering > when you should use _path and when you should use _url. Is there a > preference to which one to use? They seem to be fairly interchangeable > (in my very s

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Marnen Laibow-Koser
Tom Tom wrote: > yeah, i tried that too, but that underlaying issue here is the recursiv > xml... Once you've got the array in memory, it's not hugely difficult to step through it and generate XML. What isn't working? > thx anyway for ur help. Best, -- Marnen Laibow-Koser http://www.marnen.o

[Rails] routes: _path vs. _url

2009-10-07 Thread Zak Strassberg
Routes offers you the ability to use _path or _url as a way to make links/redirect/etc throughout your site. However, I'm just wondering when you should use _path and when you should use _url. Is there a preference to which one to use? They seem to be fairly interchangeable (in my very simple app

[Rails] How to display results from 2 views.........

2009-10-07 Thread Avnish Malik
Plz Help I just started studying Ruby so plz don't mind if my question is too novice for this forumm. I have made 2 simple database tables clients and servers and used scaffold to generate controller and views for the same. Now I can view all the available clients and servers by goin

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Tom Tom
yeah, i tried that too, but that underlaying issue here is the recursiv xml... thx anyway for ur help. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Leonardo Mateo
Guys, you're turning this into a DB flamewar and I'm sure that's what this thread was ment to. The thread title asks for the easiest DB for scaling. I agree that PostGIS rocks, and I don't agree that MySQL sucks. I like PostgreSQL very much over MySQL, I think the logos for each product speak for

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Rimantas Liubertas wrote: >> Quite wrong.  I know mySQL, if anything, a bit better than PostgreSQL. > > No you do not. You did not even know SQL_MODE. > <…> Yes, you found an obscure setting that I was unaware of. I'm sure there are more. I don't know 100% of either system's config parameters

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Rob Saul
Greg Donald wrote: > On Wed, Oct 7, 2009 at 11:21 AM, Philip Hallstrom wrote: >> So where the >> issues of inserting data that is too long and having it be silently >> truncated -- yes, I'm ignoring the warnings MySQL provides. It should >> raise an error... > > It does raise an error if you're

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Rimantas Liubertas
> Quite wrong.  I know mySQL, if anything, a bit better than PostgreSQL. No you do not. You did not even know SQL_MODE. <…> Regards, Rimantas -- http://rimantas.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Greg Donald wrote: > On Wed, Oct 7, 2009 at 12:27 PM, Marnen Laibow-Koser > wrote: >> I did not lie. �I stand by my original statement and see no reason to >> retract or revise it. > > You did lie. I have the email right in front of me. You said "I use > PostGIS a lot. There is nothing compara

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Marnen Laibow-Koser
Tom Tom wrote: > hi, > > ok, what i need and dont know know how to do is: > > > @result = Category.roots > #gives me 3, because i have 3 records with parent_id=NULL, what is fine > > @result.TO_FULL_RECURSIVE_XML You might just want to do Category.find :all, :order => 'lft', which will give

[Rails] Re: Definitive guide to Rake commands

2009-10-07 Thread Philip Hallstrom
> If I want to look up the available Rake command syntax, where do I > go to > find it? $ rake -T http://guides.rubyonrails.org/command_line.html#rake-is-ruby-make vendor/rails/railties/lib/tasks/*.rake > > For example, I've been trying to find out if there is a better way for > me to use th

[Rails] Re: Definitive guide to Rake commands

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 11:50 AM, Rob Nichols wrote: > > If I want to look up the available Rake command syntax, where do I go to > find it? rake -T -- Greg Donald http://destiney.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[Rails] Re: Multiple Domains Different Layouts

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 12:02 PM, Sean McGilvray wrote: > How do I do a before_filter @request.env['HOST'] = "somesite.com" and > tell it to display a different layout based on the requested domain? In your controller.. :layout => :calculate_layout private def calculate_layout request.env['H

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 12:27 PM, Marnen Laibow-Koser wrote: > I did not lie.  I stand by my original statement and see no reason to > retract or revise it. You did lie. I have the email right in front of me. You said "I use PostGIS a lot. There is nothing comparable for mySQL.". Then I showed

[Rails] Re: Image Resizing

2009-10-07 Thread djolley
> ImageScience:http://seattlerb.rubyforge.org/ImageScience.html Looks promising. Thanks for the referral. ... doug --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to thi

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Greg Donald wrote: > On Wed, Oct 7, 2009 at 11:51 AM, Marnen Laibow-Koser > wrote: >> Surely you can tell me you think I'm wrong without resorting to calling >> me a liar. �Let's keep this debate as civil as possible. :) > > You lied. Stop telling lies and your problem will solve itself. I did

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 11:21 AM, Marnen Laibow-Koser wrote: > Sure -- in InnoDB.  If you need transactions and full-text search on the > same table, or if you need the speed of MyISAM, you're out of luck. You can easily replicate a table to another table of a different type. What's the PostgreS

[Rails] Re: spec testing controllers

2009-10-07 Thread Marnen Laibow-Koser
Richard Schneeman wrote: > I just started using rspec and mocha to test all of my controllers. > Before I was using factory girl to test do my testing, but all those > database hits really take a long time. Are you sure that's where you're losing time? (For the record, I'm using and loving Mac

[Rails] Re: How to debug unit (and other) tests?

2009-10-07 Thread Patrick Doyle
On Wed, Oct 7, 2009 at 12:45 PM, Colin Law wrote: > 2009/10/7 Patrick Doyle : >> Are there good tips and resources for debugging unit tests? > > Have a look at the rails guide on debugging.  Particularly the section > on ruby-debug. > Thanks. That's what I was looking for. Now, if I could just

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 11:51 AM, Marnen Laibow-Koser wrote: > Surely you can tell me you think I'm wrong without resorting to calling > me a liar.  Let's keep this debate as civil as possible. :) You lied. Stop telling lies and your problem will solve itself. > Srsly?  You're claiming that the

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Tom Tom
hi, ok, what i need and dont know know how to do is: @result = Category.roots #gives me 3, because i have 3 records with parent_id=NULL, what is fine @result.TO_FULL_RECURSIVE_XML ### again, i want a xml-structure of all root-records with their children, and their children , and their

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 11:21 AM, Philip Hallstrom wrote: > So where the > issues of inserting data that is too long and having it be silently > truncated -- yes, I'm ignoring the warnings MySQL provides.  It should > raise an error... It does raise an error if you're knowledgeable enough to know

[Rails] Multiple Domains Different Layouts

2009-10-07 Thread Sean McGilvray
Hey everyone, How do I do a before_filter @request.env['HOST'] = "somesite.com" and tell it to display a different layout based on the requested domain? Thanks, Sean McGilvray --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Marnen Laibow-Koser
Tom Tom wrote: > im looking at it right now, but it doesnt look promising. seems i have > to play around with the xml-builder again. any other ideas? You can use awesome_nested_set for what you're describing. What do you mean when you say it "doesn't look promising"? Where's the problem? Wha

[Rails] Re: RMagick problem on Windows

2009-10-07 Thread Yuri Redaelli
Aldric Giacomoni wrote: > Yuri Redaelli wrote: > even >> if i followed the instructions i can see an error like: >> >> "Unable to load module ... >> -c:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.5.0-x86-mswin32/ext/RMagick2.so" >> >> But the RMagick2.so exists in that directory. sad > > Did you in

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Greg Donald wrote: > On Wed, Oct 7, 2009 at 10:11 AM, Marnen Laibow-Koser > wrote: >> * I use PostGIS a lot. There is nothing comparable for mySQL. > > This is a lie. Surely you can tell me you think I'm wrong without resorting to calling me a liar. Let's keep this debate as civil as possible

[Rails] Definitive guide to Rake commands

2009-10-07 Thread Rob Nichols
If I want to look up the available Rake command syntax, where do I go to find it? For example, if I want to look up the syntax of a Rails command I can find it at: http://api.rubyonrails.com I can even look up the core Rake api at: http://rake.rubyforge.org/ What I can't find is documentation

[Rails] Re: How to debug unit (and other) tests?

2009-10-07 Thread Colin Law
2009/10/7 Patrick Doyle : > > I'm sorry if this sounds like a totally newbie question, but... > > Are there good tips and resources for debugging unit tests? > Currently, I just fire up script/console using the "test" environment > and just poke around randomly until I hit upon some inspiration.  

[Rails] Re: RMagick problem on Windows

2009-10-07 Thread Aldric Giacomoni
Yuri Redaelli wrote: even > if i followed the instructions i can see an error like: > > "Unable to load module ... > -c:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.5.0-x86-mswin32/ext/RMagick2.so" > > But the RMagick2.so exists in that directory. sad Did you install imagemagick ? -- Posted via htt

[Rails] Re: What in the world might this be?

2009-10-07 Thread Aldric Giacomoni
RVince wrote: > > element is null > anonymous(Object name=element)prototyp...249466790 (line 3588) > anonymous()prototyp...249466790 (line 3723) > anonymous(function(), "channel[channelnote_note]", 1, function()) > prototyp...249466790 (line 3708) > anonymous()prototyp...249466790 (line 248) > kl

[Rails] Re: spec testing controllers

2009-10-07 Thread Richard Schneeman
Thanks for the reply James! These certainly look promising and merit digging into further. Looks like others have the same idea, but there is no cohesive standard/incredibly-stable&proven way to do this. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~

[Rails] Re: audio/video file read

2009-10-07 Thread Mauricio Szabo
You're missing the audiofile-dev on your linux distribution... is it installed, and is it ruby-dev installed too? On Oct 7, 10:15 am, Saurabh Peshkar wrote: > Brijesh Shah wrote: > > Checkout this links > > >http://raa.ruby-lang.org/project/ruby-audiofile/ > >http://ruby-audiofile.sourceforge.ne

[Rails] Re: Return "title" column if "caption" column is empty?

2009-10-07 Thread mike
Use read_attribute(:caption). 2009/10/7, Joshua Muheim : > > Hi all > > Oh my god, this really shouldn't be a tough one, but I just don't get > it. ;-) > > class Page < ActiveRecord::Base > def caption > caption ? caption : title > end > end > > I want to return the content of the title c

[Rails] Suggestions on best JavaScript library for 2D drawing

2009-10-07 Thread E. Litwin
I need to develop a flow charting like feature for a new application. (i.e. Drawing/sizing simple 2D shapes like squares or circles, connecting them with straight or curved lines and being able to drag and drop the shapes while maintaining the connectors. I also need to be able to annotate that sh

[Rails] Re: Unique indexes

2009-10-07 Thread mike
You could use find_or_create_by_note, too 2009/10/7, Marnen Laibow-Koser : > > Greg Donald wrote: >> On Wed, Oct 7, 2009 at 8:15 AM, RVince wrote: >>> � � � �cnote.channel_id = @channel.id >>> � � � �cnote.associate_id = current_associate.id >>> � � � �g=cnote.save >> >> begin >> cnote.save! >

[Rails] Re: Return "title" column if "caption" column is empty?

2009-10-07 Thread Philip Hallstrom
> On Wed, Oct 7, 2009 at 11:11 AM, Joshua Muheim > wrote: >> class Page < ActiveRecord::Base >> def caption >>caption ? caption : title >> end >> end > > This will produce an infinite loop. I think you want something more > like > > self.caption ? self.caption : self.title > > But honest

[Rails] Re: DRY model validation question

2009-10-07 Thread Dudebot
Thanks, Stephan, Ar & Lake! Ar: sorry about the sloppy use of the word "combine" -- I meant refactor :) On Oct 6, 12:36 pm, Lake Denman wrote: > Hi Craig, > > My solution to this problem can be found here: > > http://gist.github.com/203225 > > Basically, I just add the validations in a module a

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Rimantas Liubertas wrote: [...] > Actually, the only true reason to choose PostgreSQL over MySQL is this: > you know PostgresSQL better. Quite wrong. I know mySQL, if anything, a bit better than PostgreSQL. I know it well enough that I have run into its limitations, discovered that there's no

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Philip Hallstrom
>> 2) PostgreSQL has a better query planner than MySQL. > > MySQL's explain works great for me. > > http://dev.mysql.com/doc/refman/5.0/en/using-explain.html > > Looks nearly identical to the PostgreSQL offering: > > http://www.postgresql.org/docs/8.4/static/using-explain.html I think what the GP

[Rails] Re: Return "title" column if "caption" column is empty?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 11:11 AM, Joshua Muheim wrote: > class Page < ActiveRecord::Base >  def caption >    caption ? caption : title >  end > end This will produce an infinite loop. I think you want something more like self.caption ? self.caption : self.title But honestly I'd rename the meth

[Rails] Re: Rails Authentication Tutorial

2009-10-07 Thread Hassan Schroeder
On Tue, Oct 6, 2009 at 7:55 PM, Kevin M wrote: > sudo /usr/local/mysql/bin/mysql -u root > > I get this error: > > ERROR 2002 (HY000): Can't connect to local MySQL server through socket > '/tmp/mysql.sock' (2) > > My searching has not produced an answer. ?? Either that's not the location of the

[Rails] Re: How to debug unit (and other) tests?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 10:33 AM, Marnen Laibow-Koser wrote: > Just call the debugger from within your app code, or from the test > itself.  When the "debug" statement is executed, you'll be in an > interactive debugger.  Simple. "debug" is for use with views, and does not stop execution. <%= de

[Rails] Re: How to debug unit (and other) tests?

2009-10-07 Thread Patrick Doyle
On Wed, Oct 7, 2009 at 11:33 AM, Marnen Laibow-Koser wrote: > Patrick Doyle wrote: >> Are there good tips and resources for debugging unit tests? > > Just call the debugger from within your app code, or from the test > itself.  When the "debug" statement is executed, you'll be in an > interactive

[Rails] Return "title" column if "caption" column is empty?

2009-10-07 Thread Joshua Muheim
Hi all Oh my god, this really shouldn't be a tough one, but I just don't get it. ;-) class Page < ActiveRecord::Base def caption caption ? caption : title end end I want to return the content of the title column when the caption column is empty: p.caption # Caption is not empty # => "c

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 10:11 AM, Marnen Laibow-Koser wrote: > * I use PostGIS a lot. There is nothing comparable for mySQL. This is a lie. http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html > * MySQL makes you choose between speed and data integrity.  PostgreSQL > does not. Postgr

[Rails] Re: audio/video file read

2009-10-07 Thread Brijesh Shah
No I don't have ne idea abt this..I found these links by googling. -- 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 e

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 10:27 AM, Rimantas Liubertas wrote: > MySQL supports transactions since version 3.23.34a MySQL had replication before PostgreSQL too, I know I worked for a startup that helped fund it. MySQL supports 7 different table types so you choose the right type for the data at han

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Tom Tom
im looking at it right now, but it doesnt look promising. seems i have to play around with the xml-builder again. any other ideas? regs -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 10:02 AM, Andrew Pace wrote: > > I too choose PostgreSQL by default. > > Here are some of my reasons. > > 1) It adheres more reliably to SQL standard than MySQL. No it doesn't, they are both standards compliant. > 2) PostgreSQL has a better query planner than MySQL. MyS

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Marnen Laibow-Koser
Tom Tom wrote: > hi, i think u didnt understand my question: > > how do i get ALL roots PLUS all descendants in one go? I remember that there's a way to do this (besides find :all), but you'll have to check the docs. If you can't find it after reading the docs, let me know. > > > res = Ca

[Rails] Re: How to debug unit (and other) tests?

2009-10-07 Thread Marnen Laibow-Koser
Patrick Doyle wrote: > I'm sorry if this sounds like a totally newbie question, but... > > Are there good tips and resources for debugging unit tests? > Currently, I just fire up script/console using the "test" environment > and just poke around randomly until I hit upon some inspiration. But >

[Rails] Re: help: awesome_nested_set

2009-10-07 Thread Tom Tom
hi, i think u didnt understand my question: how do i get ALL roots PLUS all descendants in one go? res = Category.find(all, conditions{parent_id IS NULL}) res.descendants >> descendants works only on a result of size of 1 regs -- Posted via http://www.ruby-forum.com/. --~--~-~--~--

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Rimantas Liubertas
> Here are some of my reasons. > > 1) It adheres more reliably to SQL standard than MySQL. > 2) PostgreSQL has a better query planner than MySQL. > 3) The number value zero in MySQL is treated NULL. > 4) The default settings for MySQL make it case IN-sensitive. > 5) Until version 5.0, MySQL did no

[Rails] Re: output validations errors form causing type error?

2009-10-07 Thread sean
Please ignore my post, I discovered what the problem was. I had been manually adding errors to the order object from the validations of another model (active merchant's credit card class), and my mistake was that I had added the errors directly, but the errors for each attribute are an array of er

[Rails] Re: Unique indexes

2009-10-07 Thread Marnen Laibow-Koser
Greg Donald wrote: > On Wed, Oct 7, 2009 at 8:15 AM, RVince wrote: >> � � � �cnote.channel_id = @channel.id >> � � � �cnote.associate_id = current_associate.id >> � � � �g=cnote.save > > begin > cnote.save! > rescue > flash[:notice] = 'channel note failed to save' > end > > or you could che

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Marnen Laibow-Koser
Andrew Pace wrote: > I too choose PostgreSQL by default. > > Here are some of my reasons. > > 1) It adheres more reliably to SQL standard than MySQL. > 2) PostgreSQL has a better query planner than MySQL. > 3) The number value zero in MySQL is treated NULL. > 4) The default settings for MySQL ma

[Rails] Re: Access params in before_validation?

2009-10-07 Thread Heinz Strunk
Greg Donald wrote: > ... > > attr_accessor :current, :required > > > -- > Greg Donald > http://destiney.com/ Yep, that's what I needed. Thanks to both of you! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Andrew Pace
I too choose PostgreSQL by default. Here are some of my reasons. 1) It adheres more reliably to SQL standard than MySQL. 2) PostgreSQL has a better query planner than MySQL. 3) The number value zero in MySQL is treated NULL. 4) The default settings for MySQL make it case IN-sensitive. 5) Until v

[Rails] Rails, flash, function and parameter

2009-10-07 Thread Adrien Coquio
Hi, I try do update the flash on my page with ajax. I have this on my layout : <%= render :partial => 'layouts/flash' %> I have this on my ApplicationHelper : def reload_flash page.replace "flash_messages", :partial => 'layouts/flash' end and I try do that on my controller : render :upd

[Rails] output validations errors form causing type error?

2009-10-07 Thread sean.ali...@gmail.com
Hi, I was wondering if it is possible to output validation errors in a nested form? I suppose this should be possible, but I am experiencing an error message that I can't track down. The error I get is the following : TypeError in Store/orders#create Showing app/views/store/orders/new.html.erb

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 5:50 AM, Marnen Laibow-Koser wrote: > Anyway, mySQL and SQLite are problematic I've used both much success over the years. What sort of problems are you having? -- Greg Donald http://destiney.com/ --~--~-~--~~~---~--~~ You received this

[Rails] RMagick problem on Windows

2009-10-07 Thread Yuri Redaelli
Hi all, for first sorry for my english. I've a little problem with RMagick on Windows Vista. I've decided to use the "Paperclip" plugin an it works fine, than I've decided to install RMagick in order to create image thumbs but ... even if i followed the instructions i can see an error like: "U

[Rails] Re: Access params in before_validation?

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 6:39 AM, Heinz Strunk wrote: > I've got a similiar problem but need to remove two attributes I only > need for validation. > I have my model plus two attributes (current, required) and I want to > validate these two attributes before saving. I cannot create a new > instance

[Rails] Re: constant ActionView::Base::Subclasses::MainController not defined

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 8:11 AM, Joshua Partogi wrote: > Today I've just checked-out Rails version 3 Where did you get this "version 3" ? As far as I know it's not been released. -- Greg Donald http://destiney.com/ --~--~-~--~~~---~--~~ You received this messa

[Rails] Re: Unique indexes

2009-10-07 Thread Greg Donald
On Wed, Oct 7, 2009 at 8:15 AM, RVince wrote: > > > I have a unique index on Channelnote.note. > In my controller, I go to save the Channelnote. > But, if the note portion already exists, it naturally throws an error. > How can I alleviate this, so that it only saves if the note is NOT > already

[Rails] Re: How to do save_or_update with ActiveRecords?

2009-10-07 Thread Bjoern
On Oct 7, 11:52 am, Frederick Cheung wrote: > If you do User.new you will always get a new object that AR will then > try to insert. Any other options? > Sounds like you would also get an error whenever you handle a message > to / from a user you have already handled a message from. True - so

[Rails] How to debug unit (and other) tests?

2009-10-07 Thread Patrick Doyle
I'm sorry if this sounds like a totally newbie question, but... Are there good tips and resources for debugging unit tests? Currently, I just fire up script/console using the "test" environment and just poke around randomly until I hit upon some inspiration. But I think there should be a better

[Rails] Re: Rails and SQLITE

2009-10-07 Thread Hirak
Thanks a lot Rick On Oct 7, 5:46 pm, Rick wrote: > Rails tutorial:http://guides.rubyonrails.org/getting_started.html > Sqlite tutorial:http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html > > On Oct 7, 6:42 am, Hirak wrote: > > > Thanks Kashyap for the reply. Can you give me any good l

[Rails] Re: audio/video file read

2009-10-07 Thread Saurabh Peshkar
Brijesh Shah wrote: > Checkout this links > > http://raa.ruby-lang.org/project/ruby-audiofile/ > http://ruby-audiofile.sourceforge.net/ > > I think this will help u... > > Thanks > Brijesh Shah Hi Brijesh Thanks for the links I had gone through them, but ruby extconf.rb is throwing an error,

[Rails] Unique indexes

2009-10-07 Thread RVince
I have a unique index on Channelnote.note. In my controller, I go to save the Channelnote. But, if the note portion already exists, it naturally throws an error. How can I alleviate this, so that it only saves if the note is NOT already in the table? Thanks, RVince cnote = Channelnote.ne

[Rails] What in the world might this be?

2009-10-07 Thread RVince
I am using the autocomplete plugin succesfully in a Rails 2.3.2 application. However, when I run in firebug, when it first renders, I get the following error, below. Can anyone tell me what on earth might be the cause (and cure?) of this? Thanks, RVince element is null anonymous(Object name=eleme

  1   2   >