[Rails] Select statements do not work on MySQL

2009-10-13 Thread Adam Meyer
Hi everyone, I run into a problem after deploying my app to prod env on a Apache server with Passenger and MySQL5. The application works nearly fine, the only problem is that any select statements do not work on the database. For example if a user registers the app creates a new user entity in t

[Rails] Re: My App doesn't send mails

2009-10-13 Thread Adam Meyer
Thanks for all replies. I'll check it out and come back to you soon. -- 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

[Rails] Re: Problem with backgroundrb!!!

2009-10-13 Thread Sam SQA
vimal wrote: > Finally i got it after 2 days > uninstalling and installing again and again did the job for me > still i am unable to figure out the problem which caused it Hi Vimal, Can you please tell me how did you un-install the backgroundrb? Appreciate your help. Thanks, Sapna. -- Posted

[Rails] Searching a model based on a filter on its association

2009-10-13 Thread Sahil Dave
Hi all, I got association like the following in my rails app. Class User < ActiveRecord::Base has_one :profile end Class Profile < ActiveRecord::Base establish_connection :some_other_db belongs_to :user end I need to search users based on the age stored in the profile I tried using the :jo

[Rails] Render partials with nested attributes from another model

2009-10-13 Thread Ryan Tinsley
Hi everyone, My previous question was posted here. I'm starting a new topic as the problems have shifted. I have a rails application that models a house. There is a house model that has_many rooms. A room has a

[Rails] Re: how to time out a query

2009-10-13 Thread Jeff Lewis
Another alternative would be to just wrap your long-running query in a timeout, something like: require 'timeout' ... begin status = Timeout::timeout(60) do # some long-running action end rescue Timeout::Error => te # end Jeff On Oct 13, 1:07 pm, JohnB wrote: > You've proba

[Rails] Ruby/C question

2009-10-13 Thread Jeffrey L. Taylor
I am working with libxml-ruby, the Ruby wrapper for the C libxml. I don't understand one section (rxml_reader_io). The line below ('result' is the Ruby VALUE for the object): rb_ivar_set(result, IO_ATTR, io); where: IO_ATTR = ID2SYM(rb_intern("@io")); The comments lead me believe that the

[Rails] Render partials with nested attributes from another model

2009-10-13 Thread Ryan Tinsley
Hi everyone, My previous question was posted here. I'm starting a new topic as the problems have shifted. I have a rails application that models a house. There is a house model that has_many rooms. A room has

[Rails] Re: Site map

2009-10-13 Thread Smit Shah
Thanks Rob, It gives me an error like /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant SitemapGenerator (NameError) ,if I write this code in routes. So, where should I suppose to write this code? > Si

[Rails] Re: I'd like to use the mail_to method in a model

2009-10-13 Thread Rick
Here's how to use the mail_to helper in a view: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001602 On Oct 13, 5:14 pm, Joshua Muheim wrote: > Hi all > > I'd like to use the mail_to method from the views within a model: > > http://api.rubyonrails.org/classes/ActionView/

[Rails] Obama: Afghanistan decision in 'coming weeks'

2009-10-13 Thread News
Obama: Afghanistan decision in 'coming weeks' http://bit.ly/2dWFN5 http://bit.ly/2dWFN5 http://bit.ly/2dWFN5 Obama: Afghanistan decision in 'coming weeks' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on

[Rails] Re: ActiveRecord failing with a default field value of blank

2009-10-13 Thread Duane Morin
Frederick Cheung wrote: > On Oct 13, 9:32�pm, Duane Morin > wrote: >> >> where it's generating a NULL for my non-specified field, and that's >> breaking the constraint. �To the best of my ability to figure it out, >> the code that does the MailQueueItem.create has not in any way changed. >> >> I'

[Rails] Re: Why need before_validation etc methods be public?

2009-10-13 Thread Greg Donald
On Tue, Oct 13, 2009 at 12:50 PM, Joshua Muheim wrote: > Nobody knows this? No.. it's just that no one cares :) Ruby's private and protected members aren't very private or protected. It's more of an "intent" thing than a hard rule. #!/usr/bin/env ruby class Foo private def hidden p

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Conrad Taylor
On Tue, Oct 13, 2009 at 4:49 PM, Conrad Taylor wrote: > On Tue, Oct 13, 2009 at 2:53 PM, Joshua Muheim < > rails-mailing-l...@andreas-s.net> wrote: > >> >> Hi all >> >> n = Nokogiri::HTML("H1") >> n.to_s >> # => > \"http://www.w3.org/TR/REC-html40/loose.dtd >> \">\nH1 >> >> Is there a method that

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Conrad Taylor
On Tue, Oct 13, 2009 at 2:53 PM, Joshua Muheim < rails-mailing-l...@andreas-s.net> wrote: > > Hi all > > n = Nokogiri::HTML("H1") > n.to_s > # => \"http://www.w3.org/TR/REC-html40/loose.dtd > \">\nH1 > > Is there a method that only outputs the stuff I've read, and not the > whole valid XHTML stuf

[Rails] Re: ActiveRecord failing with a default field value of blank

2009-10-13 Thread Greg Donald
On Tue, Oct 13, 2009 at 3:32 PM, Duane Morin wrote: > I've got a field, mq_unsubscribe, in my mail_queue table.  It has a > non-null constraint on it, and a default value of empty string ''.  (I > did not set it up.) I'd fix the problem here by making the default null. -- Greg Donald http://de

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 2:53 PM, Joshua Muheim wrote: > n = Nokogiri::HTML("H1") > n.to_s > # => \"http://www.w3.org/TR/REC-html40/loose.dtd\";>\nH1 > > Is there a method that only outputs the stuff I've read, and not the > whole valid XHTML stuff? Well, it's not XHTML, if you note the doctype

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Joshua Muheim
> OK. So try again with an example that is closer to what you actually > need. The example above is exactly what I need. I think my question is quite simple? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Marnen Laibow-Koser
Joshua Muheim wrote: >> If all you need is the original input, then why bother running it >> through Nokogiri? > > Obviously that's just for presentation purposes... I will apply some > other stuff to the DOM, too... OK. So try again with an example that is closer to what you actually need.

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Joshua Muheim
> If all you need is the original input, then why bother running it > through Nokogiri? Obviously that's just for presentation purposes... I will apply some other stuff to the DOM, too... -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You recei

[Rails] Re: plugin or web service for printing UPS shipping labels

2009-10-13 Thread Sergio Sergio
Is there a way to do this ? I am in the same situation, I have found a way to print labels for USPS, but I need to print labels for UPS, I can't find nothing in their web page... Thanks in advice 2009/8/11 webnuwan > > Andy, > > Have you found a solution for this. I am in the same situation f

[Rails] Re: Easy Way to identify Partials

2009-10-13 Thread Marnen Laibow-Koser
Greg Donald wrote: > On Mon, Oct 12, 2009 at 3:29 AM, wrote: >> Do you know of an easy way to identify which part of a page comes from which >> partial file? Perhaps a plugin adding a border or something? > > This will add comments to your erb templates: > [...] Ooh, neat! I'll have to play w

[Rails] Re: I'd like to use the mail_to method in a model

2009-10-13 Thread Rob Biedenharn
On Oct 13, 2009, at 5:21 PM, Leonardo Mateo wrote: > On Tue, Oct 13, 2009 at 6:14 PM, Joshua Muheim > wrote: >> >> Hi all >> >> I'd like to use the mail_to method from the views within a model: >> >> http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html >> >> How can I include this

[Rails] Re: Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Marnen Laibow-Koser
Joshua Muheim wrote: > Hi all > > n = Nokogiri::HTML("H1") > n.to_s > # => \"http://www.w3.org/TR/REC-html40/loose.dtd\";>\nH1 > > Is there a method that only outputs the stuff I've read, and not the > whole valid XHTML stuff? > > Needed output: > H1 If all you need is the original input, the

[Rails] Re: Easy Way to identify Partials

2009-10-13 Thread Greg Donald
On Mon, Oct 12, 2009 at 3:29 AM, wrote: > Do you know of an easy way to identify which part of a page comes from which > partial file? Perhaps a plugin adding a border or something? This will add comments to your erb templates: unless RAILS_ENV == 'production' module ActionView module Te

[Rails] Nokogiri: to_s WITHOUT html surrounding's tags?

2009-10-13 Thread Joshua Muheim
Hi all n = Nokogiri::HTML("H1") n.to_s # => http://www.w3.org/TR/REC-html40/loose.dtd\";>\nH1 Is there a method that only outputs the stuff I've read, and not the whole valid XHTML stuff? Needed output: H1 Thanks a lot Josh -- Posted via http://www.ruby-forum.com/. --~--~-~--~~--

[Rails] Re: Auto-logout after 15 minutes....

2009-10-13 Thread Johalf Farina
Hi, Use the "session-timeout" plugin. http://github.com/lukeredpath/session-timeout/ Example: session_times_out_in 15.minutes, :after_timeout => :do_something Good luck. *Johalf Farina* +55 (51)8487 1402 Twitter Working with Rails

[Rails] Job Post - ROR Jr Programmer - Austin, TX

2009-10-13 Thread amwfllc
Ruby on Rails Programmer - Junior Our client, based in Austin, TX, is looking for a Ruby on Rails Programmer to join their dynamic team of experienced programmers. As a Ruby on Rails Programmer, you will perform a critical role in designing and building code for our top-secret, cutting edge suite

[Rails] Re: how to time out a query

2009-10-13 Thread JohnB
You've probably already figured it out, but this looks workable: # See this page for some of the statement-related settings: # http://www.postgresql.org/docs/8.3/static/runtime-config-client.html def setStatementTimeout milliseconds query = "SET statement_timeout = #{milliseconds};"

[Rails] Re: ActiveRecord failing with a default field value of blank

2009-10-13 Thread Frederick Cheung
On Oct 13, 9:32 pm, Duane Morin wrote: > > where it's generating a NULL for my non-specified field, and that's > breaking the constraint.  To the best of my ability to figure it out, > the code that does the MailQueueItem.create has not in any way changed. > > I'm hoping that somebody can say "

[Rails] Re: Test rails model with Cucumber?

2009-10-13 Thread Joshua Partogi
Hi Marnen, On Oct 14, 12:55 am, Marnen Laibow-Koser wrote: > Joshua Partogi wrote: > > Hi all, > > > Can I test my rails model with cucumber? Or is this not what cucumber > > is used for? If it is, can anyone lead me to documentation on how to > > use cuke to test Rails model please. I have read

[Rails] Auto-logout after 15 minutes....

2009-10-13 Thread RubyonRails_newbie
Hi There, Im going through the ruby on rails tutorial 'Railsspace' at the moment. There is a :remember_me function that allows a cookie to be set at login to remember the user. See below: if @user.remember_me == "1" cookies[:remember_me] = { :value => "cookie name", :e

[Rails] Re: I'd like to use the mail_to method in a model

2009-10-13 Thread Leonardo Mateo
On Tue, Oct 13, 2009 at 6:14 PM, Joshua Muheim wrote: > > Hi all > > I'd like to use the mail_to method from the views within a model: > > http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html > > How can I include this module into my model? > Ok, besides the obvious question of "W

[Rails] I'd like to use the mail_to method in a model

2009-10-13 Thread Joshua Muheim
Hi all I'd like to use the mail_to method from the views within a model: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html How can I include this module into my model? Thanks Josh -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~---

[Rails] Re: Why need before_validation etc methods be public?

2009-10-13 Thread Conrad Taylor
On Tue, Oct 13, 2009 at 12:02 PM, Joshua Muheim < rails-mailing-l...@andreas-s.net> wrote: > > OK, thank you. I don't really get why Ruby handles protected this way, > but at least I know how, now. :-) > Most languages which has this protected keyword handles it this way. Another option would be

[Rails] Re: named scope for 'all without conditional associations'

2009-10-13 Thread Max Williams
Matt Jones wrote: > At the risk of sounding dense, is there a reason you can't cache the > most recent signon date in the User object itself? Several of the auth > plugins will even handle this automatically... > > Consider it an equivalent to the counter_cache option for an > association; the co

[Rails] Re: attr_accessible :field - obj.field="xxx" still possible?

2009-10-13 Thread Marnen Laibow-Koser
Joshua Muheim wrote: [...] > Now I just redeclared the field=(str) method to be private. Would you > suggest this to be a clean way to "unset" the method? No. If you want to do that, use remove_method or undef_method. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Pos

[Rails] Re: Error Handling in Scaffolds

2009-10-13 Thread Phoenix Rising
Yep, I missed the standard routing at the end of routes.rb. However, if I remove that, it would definitely cause problems with my existing (non-scaffolded) controllers. But it's probably still a great way to go with a fresh app. And yes, I always test with multiple get/posts on actions that can

[Rails] Re: Error Handling in Scaffolds

2009-10-13 Thread Colin Law
2009/10/13 Phoenix Rising : > > Hi Colin, > > Thanks for the reply.  I just did try this and unfortunately, my > original assessment was correct: vulnerable to XSS. > > Here's how to repeat: > Make a new rails app, then generate a scaffold: script/generate > scaffold Event when:datetime until:date

[Rails] ActiveRecord failing with a default field value of blank

2009-10-13 Thread Duane Morin
I have a bug in my code that's caught me completely off guard, and I'm hoping that maybe my IT folks updated a gem somewhere that changed something I didn't know about. I've got a field, mq_unsubscribe, in my mail_queue table. It has a non-null constraint on it, and a default value of empty stri

[Rails] RSpec, flash messages and redirection

2009-10-13 Thread Leonardo Mateo
Hello everybody I'm having some problems with RSpec. 1) When using something like "I should see 'some text'" that text is set on a flash message in the controller and displayed by = flash[:notice] in the layout view, so the relevant part of my view says, in haml: .notice = flash[:notice] The rsp

[Rails] Re: Easy Way to identify Partials

2009-10-13 Thread mike
Thanks for your. I was already aware of the log file. It is OK, but it would be fine if i had some hints in the rendered HTML. Something like Flux Compensator Showing you a Product Product Name: Flux Compensator Parts: Hypercapacitor Gizmo Thank you for your interest in Flux Compensator I

[Rails] Re: Error Handling in Scaffolds

2009-10-13 Thread Phoenix Rising
Hi Colin, Thanks for the reply. I just did try this and unfortunately, my original assessment was correct: vulnerable to XSS. Here's how to repeat: Make a new rails app, then generate a scaffold: script/generate scaffold Event when:datetime until:datetime title:string description:string Next,

[Rails] Re: Need a clear view on this

2009-10-13 Thread Philip Hallstrom
On Oct 13, 2009, at 12:48 PM, jhaagmans wrote: > >> I suppose some of it would depend on the following: >> >> - How many records will have this field? > > Not too many. For the moment about 90 records. > >> - How many numbers on average will be in the field? > > At first it will probably only be

[Rails] Re: Error Handling in Scaffolds

2009-10-13 Thread Colin Law
2009/10/13 Phoenix Rising : > > Howdy all, > > I've never been one to use scaffolds in my Rails projects, but I'm > looking at it right now as a possible time saver.  I spend a > ridiculous amount of time building the forms, and slightly less (but > more than I'd like) building the controller(s) f

[Rails] Re: Need a clear view on this

2009-10-13 Thread jhaagmans
> I suppose some of it would depend on the following: > > - How many records will have this field? Not too many. For the moment about 90 records. > - How many numbers on average will be in the field? At first it will probably only be 1, 2 and 3. It might grow later on however. > - How many ins

[Rails] Error Handling in Scaffolds

2009-10-13 Thread Phoenix Rising
Howdy all, I've never been one to use scaffolds in my Rails projects, but I'm looking at it right now as a possible time saver. I spend a ridiculous amount of time building the forms, and slightly less (but more than I'd like) building the controller(s) for a new model when developing my applica

[Rails] Re: Need a clear view on this

2009-10-13 Thread Philip Hallstrom
> I would like to store possible values in a database, to make them > available in a select list. The possible values consist of one ore > more of the values between 1 and 100. So if I would put an example in > an array, it could be [1,2,19,43,46,81,93]. I'd like to know what the > best way to sto

[Rails] Need a clear view on this

2009-10-13 Thread jhaagmans
Hi, I would like to store possible values in a database, to make them available in a select list. The possible values consist of one ore more of the values between 1 and 100. So if I would put an example in an array, it could be [1,2,19,43,46,81,93]. I'd like to know what the best way to store th

[Rails] Re: attr_accessible :field - obj.field="xxx" still possible?!

2009-10-13 Thread Joshua Muheim
Joshua Muheim wrote: >> because that's not what attr_protected is supposed to do - it is only >> supposed to stop the field getting updated when you do >> object.update_attributes(...) and similar. why the save isn't working >> for you is another issue. > > OK, so it is normal, that every field i

[Rails] Re: Why need before_validation etc methods be public?

2009-10-13 Thread Joshua Muheim
OK, thank you. I don't really get why Ruby handles protected this way, but at least I know how, now. :-) -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Tal

[Rails] Re: named scope for 'all without conditional associations'

2009-10-13 Thread Matt Jones
At the risk of sounding dense, is there a reason you can't cache the most recent signon date in the User object itself? Several of the auth plugins will even handle this automatically... Consider it an equivalent to the counter_cache option for an association; the complicated left join stuff is s

[Rails] Re: How to exit rails application from within

2009-10-13 Thread Damjan Rems
pepe wrote: > What do you mean by "restarting" the application? Do you mean end the > session (if any) and (re)display the login/index/initial page? > > If you need to end a session you can do it with this: > > reset_session > > To send a user to the login/index/initial page you can just use a

[Rails] Re: Passing id array as option in find_by_solr

2009-10-13 Thread Matt Jones
On Oct 12, 4:40 am, adedip wrote: > Needs: I wan'to apply the solr query by keyword to a subgroups of > documents. > > I'm putting on the index only title and content of each, is it > possibile to do something like this: > > @articles = Article.find_by_solr(params[:query], {:scores => true, :id

[Rails] Re: Migrating Rails App to New Host/IP with No Downtime?

2009-10-13 Thread JimCifarelli
Thanks Fred and Hassan. For anyone following this thread, here' a tidy means for performing the proxy with Apache: http://blog.vacs.fr/index.php?post/2009/01/25/21-transparent-web-server-migration-with-apache-proxy I'm not sure I'll want to bring services down in order to dump/restore the produc

[Rails] Re: Why need before_validation etc methods be public?

2009-10-13 Thread bill walton
Hi Josh, On Tue, 2009-10-13 at 19:50 +0200, Joshua Muheim wrote: > Joshua Muheim wrote: > > Hi all > > > > I just wondered why a private before_validation method is not called > > when an ActiveRecord object is saved? When it's public, then it works... > > Why is that? In my opinion, the before_

[Rails] Re: Processing an XML list in a controller

2009-10-13 Thread Matt Jones
If that's actually what's in params, somebody's already parsed the XML. No REXML needed... --Matt On Oct 12, 11:29 am, "grant.tf" wrote: > Hi > > thnkas for the responses, I have tried to prgress this by using REXML, > and I have tried creating an REXL doc using > > doc = REXML::Document.new ra

[Rails] Re: How can I parse encoded and serialized XML with REXML?

2009-10-13 Thread Matt Jones
Not really a solution, but this has to be a classic example of PHP- programmer-bass-ackwardness. They're already writing to an extensible serialization format (XML) but then just whack language-specific serialized data in instead. That's right up there with the HTTP-over- SOAP-over-HTTP stuff I've

[Rails] Passing parameter to open dialog using link_to_function

2009-10-13 Thread John Mcleod
Hello all, I'm having one fun time trying to past a parameter to a javascript function using link_to_function. This is what I have... 1. A simple project, controller, views, model. 2. Prototype Window dialog box installed. What I'm trying to do is on the index.html.erb, instead of link_to "show"

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 10:56 AM, rtacconi wrote: > I cannot see any error in catalina.2009-10-13.log, so the ROOT.xml > error is gone. But I still have "We're sorry, but something went > wrong." I changed web.xml to development, but I cannot see any log. Did you restart Tomcat after changing t

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread rtacconi
Well I have wasted my time by reinstalling Tomcat :-) I cannot see any error in catalina.2009-10-13.log, so the ROOT.xml error is gone. But I still have "We're sorry, but something went wrong." I changed web.xml to development, but I cannot see any log. I must be a severe error. I have the MySql

[Rails] Using a method from another class

2009-10-13 Thread BLoudermilk
I'm writing a unit test that inherits from ActionController::TestCase, but I need to access a method in ActiveResource::Connection. Is this possible? How can I do it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "R

[Rails] Re: Why need before_validation etc methods be public?

2009-10-13 Thread Joshua Muheim
Joshua Muheim wrote: > Hi all > > I just wondered why a private before_validation method is not called > when an ActiveRecord object is saved? When it's public, then it works... > Why is that? In my opinion, the before_validation method should > intuitively rather be private... > > Thanks > Josh

[Rails] Re: Migrating Rails App to New Host/IP with No Downtime?

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 10:17 AM, Frederick Cheung wrote: >> 1. I like the use of the "temporary" new.foo.com domain name and >> redirect. >> Do you know how well Ruby libraries like Net::HTTP, ActiveResource, or >> RestClient will handle 302 Redirects? >> I'm concerned that user's "posts" to th

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 10:30 AM, rtacconi wrote: > > I am deploying a test. I think I have mess up ROOT.xml few days ago. I > will try to have a clean Tomcat Geez, NO. Just FIX the stupid ROOT context file. The error message is telling you exactly what's wrong. No need to reinstall Tomcat, was

[Rails] Re: attr_accessible :field - obj.field="xxx" still possible?!

2009-10-13 Thread Joshua Muheim
> because that's not what attr_protected is supposed to do - it is only > supposed to stop the field getting updated when you do > object.update_attributes(...) and similar. why the save isn't working > for you is another issue. OK, so it is normal, that every field in the database has its own ge

[Rails] Re: config.action_controller.session[:secret] vs protect_from_forgery :secret

2009-10-13 Thread Frederick Cheung
On Oct 13, 5:20 pm, Marcelo de Moraes Serpa wrote: > What I want to do is share the same session across many Rails applications. > All of them are using Rails 2.2.2. I know that, to share the session, it's > (supposedly) just a matter of sharing the same key and secret among the > apps, like th

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread rtacconi
I am deploying a test. I think I have mess up ROOT.xml few days ago. I will try to have a clean Tomcat, then I will deploy test.war again. Thanks. On Oct 13, 6:08 pm, Hassan Schroeder wrote: > On Tue, Oct 13, 2009 at 10:05 AM, rtacconi wrote: > > > Wait wait, I have found this: > > > 13-Oct-20

[Rails] Re: attr_accessible :field - obj.field="xxx" still possible?!

2009-10-13 Thread Frederick Cheung
On Oct 13, 6:25 pm, Joshua Muheim wrote: > Hi all > > MyClass < ActiveRecord::Base >   attr_protected :field > end > > In script/console: > > x = MyClass.find 1 > # => field = "original" > x.field="blah" > # => "blah" > x.save > # => ... > x = MyClass.find 1 > # => field = "original" > > Why is

[Rails] attr_accessible :field - obj.field="xxx" still possible?!

2009-10-13 Thread Joshua Muheim
Hi all MyClass < ActiveRecord::Base attr_protected :field end In script/console: x = MyClass.find 1 # => field = "original" x.field="blah" # => "blah" x.save # => ... x = MyClass.find 1 # => field = "original" Why is there still a field=() method (even though it doesn't work when saving the

[Rails] Re: Migrating Rails App to New Host/IP with No Downtime?

2009-10-13 Thread Frederick Cheung
On Oct 13, 5:00 pm, JimCifarelli wrote: > Thank you Fred for your response. > > 1. I like the use of the "temporary" new.foo.com domain name and > redirect. > Do you know how well Ruby libraries like Net::HTTP, ActiveResource, or > RestClient will handle 302 Redirects? > I'm concerned that user

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 10:05 AM, rtacconi wrote: > > Wait wait, I have found this: > > 13-Oct-2009 18:00:12 org.apache.catalina.startup.HostConfig > deployDescriptor > SEVERE: Error deploying configuration descriptor ROOT.xml > org.xml.sax.SAXParseException: The element type "Context" must be >

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread rtacconi
Wait wait, I have found this: 13-Oct-2009 18:00:12 org.apache.catalina.startup.HostConfig deployDescriptor SEVERE: Error deploying configuration descriptor ROOT.xml org.xml.sax.SAXParseException: The element type "Context" must be terminated by the matching end-tag "". at com.sun.org.apac

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread rtacconi
I changed to development but I cannot see any change, except when I call http://10.3.111.79:8080/test/posts, Tomcat hangs, does not reply. On Oct 13, 5:34 pm, Hassan Schroeder wrote: > On Tue, Oct 13, 2009 at 9:08 AM, rtacconi wrote: > > I created a super simple Rails app with generate scaffold

[Rails] Re: SOAP

2009-10-13 Thread Robert Walker
Eric Seijo wrote: > I have a project where I need to access NetSuite's SuiteTalk platform > which uses a SOAP based web service. What would be the best way / > Rails Way to go about this? Has anyone had any experience using > soap4r? You could try this: http://github.com/datanoise/actionwebserv

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 9:08 AM, rtacconi wrote: > I created a super simple Rails app with generate scaffolding, one > table with one column. On tomcat on my Win PC the app is working. On > Tomcat on Solaris not. My web.xml is this: >   >    rails.env >    production >   > As you can see is in

[Rails] config.action_controller.session[:secret] vs protect_from_forgery :secret

2009-10-13 Thread Marcelo de Moraes Serpa
What I want to do is share the same session across many Rails applications. All of them are using Rails 2.2.2. I know that, to share the session, it's (supposedly) just a matter of sharing the same key and secret among the apps, like this: config.action_controller.session = { :session_key => '

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread rtacconi
Thanks, for your help. I created a super simple Rails app with generate scaffolding, one table with one column. On tomcat on my Win PC the app is working. On Tomcat on Solaris not. My web.xml is this: http://java.sun.com/dtd/web-app_2_3.dtd";> rails.env production public.

[Rails] Re: How to exit rails application from within

2009-10-13 Thread pepe
What do you mean by "restarting" the application? Do you mean end the session (if any) and (re)display the login/index/initial page? If you need to end a session you can do it with this: reset_session To send a user to the login/index/initial page you can just use a redirect: redirect_to :cont

[Rails] Re: Migrating Rails App to New Host/IP with No Downtime?

2009-10-13 Thread JimCifarelli
Thank you Fred for your response. 1. I like the use of the "temporary" new.foo.com domain name and redirect. Do you know how well Ruby libraries like Net::HTTP, ActiveResource, or RestClient will handle 302 Redirects? I'm concerned that user's "posts" to the application will fail when confronted

[Rails] Re: Rails Scaffold for Existing Model

2009-10-13 Thread Guo Yangguang
is there any options for scaffold script? -- 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@

[Rails] Re: booting failure

2009-10-13 Thread Hassan Schroeder
On Mon, Oct 12, 2009 at 10:28 PM, Devendran Ganesan wrote: >> Have you tried doing what the message tells you to do, e.g. install >> the jruby-openssl gem? > ya i have tried that. > but still getting the same error message What's the output of which jruby jruby -S gem list

[Rails] Re: Default .rjs

2009-10-13 Thread jhaagmans
It will return error messages like any other Rails requests, but it won't update your flash, so the only thing that happens is that it returns an error. You won't be able to show it if you can't update the page. What I'll do now, for the time being: def create @item = Item.new(params[:item])

[Rails] Re: Formatting Dates in my view

2009-10-13 Thread Tony
You can put something like this in your environment.rb if you will be using that format often: ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!( :show_time => "%l:%M%p", :reminder_time => "%B %d, %Y", :simple_time => "%H:%M:%S" ) Then just to something like Time.now.t

[Rails] Re: ODBC with Snow Leopard

2009-10-13 Thread tomrossi7
Here is some information for anyone else struggling with this: http://groups.google.com/group/rails-sqlserver-adapter http://www.metaskills.net/2009/9/5/the-ultimate-os-x-snow-leopard-stack-for-rails-development-x86_64-macports-ruby-1-8-1-9-sql-server-more Anyone else got any good resources to g

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread Hassan Schroeder
On Tue, Oct 13, 2009 at 6:33 AM, rtacconi wrote: > Sorry, not litterally, it is the tipical Rails error, but it happens > on Tomcat, we Rails deployed as WAR. There is nothing in Rails logs, > nothing in tomcat log too! I have Tomcat on my PC and I get the same > error. But Tomcat in my PC is ru

[Rails] Re: il.add_index question

2009-10-13 Thread Stephen Burke
I see what your saying yeah, that could work.  Before I add it to the table, I would get it in the form id1 < id2 & then my previous index would work the same way essentially catching both of the cases I was describing. Thanks for the help. Steve On Tue, Oct 13, 2009 at 3:22 AM, Colin Law wrote

[Rails] Re: il.add_index question

2009-10-13 Thread Marnen Laibow-Koser
Colin Law wrote: > 2009/10/13 steveb56 : >> add_index(:friendships, [:friend_id1, :friend_id2], :unique => true) >> >> I would also like to add an index to take care of the following >> situation... >> >> id1  id2 >> 1    2 >> 2    1   # Error, since it's the same as the first record > > Could yo

[Rails] Re: Default .rjs

2009-10-13 Thread Marnen Laibow-Koser
jhaagmans wrote: > But it can't be that I'm the only one who wants to implement such > functionality! It's something every Rails programmer using AJAX calls > will face, isn't it? How do those people handle centralized error > messages? Do they just add code to every rjs file? If you use validati

[Rails] Re: Using transaction in non-active record model

2009-10-13 Thread Marnen Laibow-Koser
Andrew Pace wrote: > Sorry about above. The post should be: > > I want to use logical models to aggregate data to present information > to the user. For example, I might have a controller that looks like > the following: > > class OrdersController < ApplicationController > def new > @ord

[Rails] Re: Rails Scaffold for Existing Model

2009-10-13 Thread Pat
Hi there, I’ve actually just started working on a gem I call "ViewMapper" that creates view scaffolding from existing models: http://patshaughnessy.net/view_mapper It can create the standard CRUD scaffolding you're looking for, or setup views that work with other plugins/gems like auto_complete

[Rails] Script sometimes sends random data to database?

2009-10-13 Thread Aldric Giacomoni
I use the rufus-scheduler to execute jobs within my Rails application. I have the following code: http://pastie.org/652937 This is run every ~10 min. The database is mySQL, just in case it matters. The data that gets skewed / screwed up is "score_keeper". As far as I can tell, what I wrote should

[Rails] Re: Test rails model with Cucumber?

2009-10-13 Thread Marnen Laibow-Koser
Joshua Partogi wrote: > Hi all, > > Can I test my rails model with cucumber? Or is this not what cucumber > is used for? If it is, can anyone lead me to documentation on how to > use cuke to test Rails model please. I have read the cuke wiki rails > section, but I still can not understand how to

[Rails] Re: Test rails model with Cucumber?

2009-10-13 Thread Tim Riendeau
Cucumber is meant to be used for integration testing. You should use one of the unit test frameworks (rspec, shoulds, test::unit) to test your models specifically. --Tim Riendeau On Oct 13, 2009, at 9:02 AM, Joshua Partogi wrote: > > Hi all, > > Can I test my rails model with cucumber? Or

[Rails] Re: We're sorry, but something went wrong on Tomcat

2009-10-13 Thread rtacconi
Sorry, not litterally, it is the tipical Rails error, but it happens on Tomcat, we Rails deployed as WAR. There is nothing in Rails logs, nothing in tomcat log too! I have Tomcat on my PC and I get the same error. But Tomcat in my PC is running stand alone not as development server, I have not ide

[Rails] Re: How to protect against DoS?

2009-10-13 Thread Ar Chron
Welcome to the pointy end of online course registration. Cache the initial 'courses' results. I don't know how your institution has its data organized, but I'll assume that there are X Courses available. Cache either that initial page, or cache the Matter.find() results so you aren't pinging t

[Rails] Re: empty parameter submitted but .nil failed to detect it

2009-10-13 Thread srinivasan sakthivel
Hi friend, U can try this, if params[:catergory] != nil On Tue, Oct 13, 2009 at 5:41 PM, Colin Law wrote: > > 2009/10/13 ct9a : > > > > hi guys > > > > i have a form which has an element, "category id". > > > > When i submit it with values, i can see param(:category) with a value > > (a

[Rails] Re: Rails Development and Solid State Drive (SSD)

2009-10-13 Thread Frederick Cheung
On Oct 13, 1:41 pm, Hunt Jon wrote: > Hi - I'm wondering if using a SSD-based Mac has noticeable performance > gain in the Rails or any general development. > > I'm especially curious to know the speed of testing including autotest > and autospec. > > Anybody using 13/15inch MacBook Pro with SS

[Rails] Test rails model with Cucumber?

2009-10-13 Thread Joshua Partogi
Hi all, Can I test my rails model with cucumber? Or is this not what cucumber is used for? If it is, can anyone lead me to documentation on how to use cuke to test Rails model please. I have read the cuke wiki rails section, but I still can not understand how to use cuke to test my model. Many

[Rails] Proper Way to Force Model to be Creation-time Only Member of another

2009-10-13 Thread Aaron Broad
Hi all, What is the proper way to do this. I have a Bundle model. And I wish for it to be able to have many Products. But I wish that the products that a bundle has only be able to be set at the creation time of the Bundle. That is once a Bundle is created I should not be able to remove or ad

  1   2   >