[Rails] Re: Cucumber + Ajax
the cucumber/webrat visit is not a xhr (ajax) call. You probably need to go with watir or selenium... On 16 Dez., 06:55, Abhishek shukla bettera...@gmail.com wrote: Hello Friends. I have a scenario where I am using link_to_remote For a ajax request. Cucmber Script Then I click on Active Steps Then /^I click on ([^\]*)$/ do |click| visit(/controller/some_action...@office.id}) end controller def some_action if post.xhr? something end end But When I run the cucumber script I am post.xhr? FALSE But the same I am getting true from browser Can you please help me out Where I am getting worng? thanks abhis -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Are class variables and class instance variables shared among different requests?
Hi, I just wanted some clarification on this. In production mode, while I know that object instance variables are local to the object and so to the request, but is this same with class variables and class instance variables or are they shared between requests? I have this question, because I know that classes are cached in production mode. But what does this mean? Like, classes are initialised and cached at the start of the server (and so are class variables and class level instance variables) and are persistent in the memory throughout, or it's like, just class definitions are cached (so they are not read every time from the disk), and they are re- initialised for every request, so that every request has its own set? Say, in file `lib/example.rb` I have defined something like - #lib/example.rb module Example class self def assign value @@class_variable = value @class_instance_variable = value end def read [@@class_variable, @class_instance_variable] end end end #app/controllers/application_controller.rb class ApplicationController ActionController::Base before_filter :initialise def initialise Example.assign params[:name] end end 1. Request A comes with params[:name] as a. 2. While request A executes, request B comes with params[:name] as b. 3. Now after arrival of request B, if code in request A accesses Example.read(), what would it return? ['b', 'b'], ['a', 'a'] or (maybe, just maybe) ['a', 'b']? I'd also like to write one more example - #lib/example.rb module Example class self @@class_variable = 'default' @class_instance_variable = 'default' def assign value @@class_variable = @class_instance_variable = value end def read [@@class_variable, @class_instance_variable] end end end 1. Request A comes, executes Example.assign('a') and finishes. 2. Request B comes and tries to execute Example.read(), without modifying the variables. What would it get? default or a? PS: While writing, I felt like this is a silly question. I'm a novice, anyway. - thanks. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
thanks - so I do want to have the images etc authenticated as well by the way, so this is why I haven't got them under public either... so the two test scenarios are based on doing a save as from a website, and then: (a) saving the web content directly under /public - which runs fast (b) having the content in a protected area, and then having rails serve it up via a controller - again that does (a) authentication via authlogic and then (b) serves via paperclip which stores files on disk, however there is a look to the database to find out where the file is I'm not sure how to attach the images here, however the results basically show that on average, picking some of the images/css etc that the browser fetches: * a ~10kb javascript file: 10ms = 497ms * a 1kb image: 5ms = 29ms . . This is measured from a browser running on the same server as the ./ script/server -e production, mongrel server... On Dec 16, 5:18 pm, Andrew Pace andrewpp...@gmail.com wrote: I believe that paperclip actually stores a copy of the images in the public directory by default. Once the html is rendered to the browser the image requests should not go through the rails stack. Let us know what firebug says. Browser load times are dependent on many factors, and often the rails stack is not the slowest piece of the pie. Once you prove there is some evidence that rails is significantly slowing you down, then it would be worth trying to optimize it. But minimizing javascript, css, and images often has a more profound effect on browser load times. Then caching pages, actions, etc helps immensely too. Let us know the firebug or safari browser load time for each part of the http requests. Andrew -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
http://www.engineyard.com/blog/2009/your-pages-will-load-faster-with-rails/ On Dec 16, 2:19 pm, greghauptmann greg.hauptm...@gmail.com wrote: thanks - so I do want to have the images etc authenticated as well by the way, so this is why I haven't got them under public either... so the two test scenarios are based on doing a save as from a website, and then: (a) saving the web content directly under /public - which runs fast (b) having the content in a protected area, and then having rails serve it up via a controller - again that does (a) authentication via authlogic and then (b) serves via paperclip which stores files on disk, however there is a look to the database to find out where the file is I'm not sure how to attach the images here, however the results basically show that on average, picking some of the images/css etc that the browser fetches: * a ~10kb javascript file: 10ms = 497ms * a 1kb image: 5ms = 29ms . . This is measured from a browser running on the same server as the ./ script/server -e production, mongrel server... On Dec 16, 5:18 pm, Andrew Pace andrewpp...@gmail.com wrote: I believe that paperclip actually stores a copy of the images in the public directory by default. Once the html is rendered to the browser the image requests should not go through the rails stack. Let us know what firebug says. Browser load times are dependent on many factors, and often the rails stack is not the slowest piece of the pie. Once you prove there is some evidence that rails is significantly slowing you down, then it would be worth trying to optimize it. But minimizing javascript, css, and images often has a more profound effect on browser load times. Then caching pages, actions, etc helps immensely too. Let us know the firebug or safari browser load time for each part of the http requests. Andrew -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails application template divided into sub-templates
But I am writing about templates you use when you are creating NEW APPLICATION by calling rails depot -m template.rb not about view templates. Guess partials don't really help here. On Dec 15, 3:46 pm, Kaid quadfol...@gmail.com wrote: Hello, you've got partial. Try searching rails partial. On Dec 15, 7:51 pm,Jakubjakub.ho...@gmail.com wrote: Greetings! I like the idea of application templates in Rails but having everything in one file is a big mess so I decided to divide it into smaller chunks. Since I haven't been able to figure out any standard or better way how to do it, here is my solution - the sub_template method - just put it to your template.rb and use it (you just have to specify the '-m' option with full path and do not to use some remote repository). Btw - is there some better/cleaner way how to do it? Example if template.starts_with?('../') or template.starts_with?('./') raise Please specify the '-m' parameter with full path. end def sub_template(name) code = File.new(name).readlines.join self.instance_eval(code) end template_root = File.dirname(File.expand_path(template)) sub_template(template_root + '/db.rb') --- Tested on: Rails 2.3.5 Repository: you can find my template using this technique onhttp://github.com/HakubJozak/railroad_tie Pre-requisities: - binding of runner contains 'template' variable (it is there now but it might break in next version) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Rails application template divided into sub-templates
Hi, Jakub. Sorry I didn't read your post carefully :p. On Wed, Dec 16, 2009 at 5:41 PM, Jakub jakub.ho...@gmail.com wrote: But I am writing about templates you use when you are creating NEW APPLICATION by calling rails depot -m template.rb not about view templates. Guess partials don't really help here. On Dec 15, 3:46 pm, Kaid quadfol...@gmail.com wrote: Hello, you've got partial. Try searching rails partial. On Dec 15, 7:51 pm,Jakubjakub.ho...@gmail.com wrote: Greetings! I like the idea of application templates in Rails but having everything in one file is a big mess so I decided to divide it into smaller chunks. Since I haven't been able to figure out any standard or better way how to do it, here is my solution - the sub_template method - just put it to your template.rb and use it (you just have to specify the '-m' option with full path and do not to use some remote repository). Btw - is there some better/cleaner way how to do it? Example if template.starts_with?('../') or template.starts_with?('./') raise Please specify the '-m' parameter with full path. end def sub_template(name) code = File.new(name).readlines.join self.instance_eval(code) end template_root = File.dirname(File.expand_path(template)) sub_template(template_root + '/db.rb') --- Tested on: Rails 2.3.5 Repository: you can find my template using this technique onhttp:// github.com/HakubJozak/railroad_tie Pre-requisities: - binding of runner contains 'template' variable (it is there now but it might break in next version) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
Some good points in the link - but I'm thinking it still doesn't address the large fundamental increase in response time when having to go through rails for the authentication etc. In both cases in the comparison for example there was no expires time populated. I'm thinking maybe what i need to address is whether it's normal that adding some extra code paths and a few database calls (authlogic and paperclip lookup) should be taking this extra 300-400ms or so, or whether there is something wrong here? Perhaps I'll need to under the paperclip and authlogic code so I put some logging code in to measure the times? On Dec 16, 7:29 pm, Arun Srini arunro...@gmail.com wrote: http://www.engineyard.com/blog/2009/your-pages-will-load-faster-with-... On Dec 16, 2:19 pm, greghauptmann greg.hauptm...@gmail.com wrote: thanks - so I do want to have the images etc authenticated as well by the way, so this is why I haven't got them under public either... so the two test scenarios are based on doing a save as from a website, and then: (a) saving the web content directly under /public - which runs fast (b) having the content in a protected area, and then having rails serve it up via a controller - again that does (a) authentication via authlogic and then (b) serves via paperclip which stores files on disk, however there is a look to the database to find out where the file is I'm not sure how to attach the images here, however the results basically show that on average, picking some of the images/css etc that the browser fetches: * a ~10kb javascript file: 10ms = 497ms * a 1kb image: 5ms = 29ms . . This is measured from a browser running on the same server as the ./ script/server -e production, mongrel server... On Dec 16, 5:18 pm, Andrew Pace andrewpp...@gmail.com wrote: I believe that paperclip actually stores a copy of the images in the public directory by default. Once the html is rendered to the browser the image requests should not go through the rails stack. Let us know what firebug says. Browser load times are dependent on many factors, and often the rails stack is not the slowest piece of the pie. Once you prove there is some evidence that rails is significantly slowing you down, then it would be worth trying to optimize it. But minimizing javascript, css, and images often has a more profound effect on browser load times. Then caching pages, actions, etc helps immensely too. Let us know the firebug or safari browser load time for each part of the http requests. Andrew -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: rjs replace_html with a partial select box not working
is it that :prompt needs a string ? Tonypm -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] mysql character set = UTF-8 on a cloumn in a migration
Hi, I want to change a single table field to UTF-8, but cant see a way of defining this in a migration. Does anyone know if there is a way, or if it has to be an sql snippet, how would I add that? Thanks Tony -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Need help...NameError in InteractController#add_to_cart
I am following the text agile web development with railshere is my code, class InteractController ApplicationController def index �...@products = Product.find_products_for_sale enddef add_to_cart product = Product.find(params[:id])�...@cart = find_cart �...@cart.add_product(product) rescue ActiveRecord::RecordNotFound logger.error(Attempt to access invalid product #{params[:id]}) flash[:notice] = Invalid product redirect_to :action = 'index'end def empty_cart session[:cart] = nil flash[:notice] = Now,your cart is currently empty redirect_to :action = 'index'end private def redirect_to_index(msg) flash[:notice] = msg redirect_to :action = 'index' end end Regards and Respects, Kindness in thought leads to wisdom. Kindness in speech leads to eloquence. Kindness in action leads to love. --- On Tue, 12/15/09, tom tomabr...@gmail.com wrote: From: tom tomabr...@gmail.com Subject: Re: [Rails] Need help...NameError in InteractController#add_to_cart To: rubyonrails-talk@googlegroups.com Date: Tuesday, December 15, 2009, 2:47 PM - which tutorial are u following? - can u show ur cart-model? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Need help...NameError in InteractController#add_to_cart
2009/12/16 Oluwayomi Oluwadara yomid...@yahoo.com I am following the text agile web development with rails here is my code, There is no point repeatedly posting the same code. As has been pointed out several times the problem is that you are missing the find_cart method. In Agile Development With Rails this is in the StoreController, as has also been pointed out to you previously. I suggest you go back to the book and have another look. I believe you can even download the application source if you wish. Colin -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Too many methods in the model? Extra lightweight logic layer?
P.S. Couple methods you listed seem good candidates to remain in model class. I suspect they are core of business logic and most important actions called in the controller. If there's more than a dozen of them, I'd probably try to make them very short by extracting common parts into utility methods (and move them to another module). On Dec 15, 8:44 pm, Wojciech Kruszewski wojci...@oxos.pl wrote: I try to keep only high-level functionality and business logic in the models. Here's the drill: 1. identify things that are not specific to your model or application and then extract them into a plugin 2. identify things that are specific to your application, but not to your model and extract them into a lib 3. find groups of related methods that are lower level (used only in this model itself) and extract them into modules (in models dir) What's left is a concise interface with some behaviours in declarative style (like acts_as_taxable). I've seen this working pretty well in largish 7 years old Rails application. Initially I haven't appreciate such terse models until I came across some bloated ones. I then couldn't quickly figure out what I can do with an instance of this model. Regards, Wojciech --http://twitter.com/WojciechK On Dec 14, 6:00 pm, Jeff cohen.j...@gmail.com wrote: On Dec 14, 10:24 am, Andrew Edwards and...@workingtechnology.co.uk wrote: Hi, Given the convention of fat models to handle business logic, is there a point where you might be justified in using a separate plain ruby object(s) to orchestrate certain business logic interactions, essentially a middle layer between your controllers and models for high level functions? If you look at the InventoryTransaction model below you will see the sort of methods I mean. In this case they are similar to factory methods I suppose. However, I could end up with around 30+ different method handling different kinds of inventory adjustments. The idea is fat model *layer*, not necessarily fat model classes. You should feel free to factor out inventory-handling methods into separate Ruby modules or classes, and use them from within your InventoryTransaction class. That way your ActiveRecord class isn't cluttered with lots of methods. I tend to keep such modules and pure- Ruby classes in the models directory, but some people prefer to keep them in lib/ instead. Jeff purpleworkshops.com -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: shear madness
Trausti and Jemminger - thank you I really never thought about i that way :O) On 16 Dec., 04:55, jemminger jemmin...@gmail.com wrote: On Dec 15, 3:30 pm, Trausti Thor Johannsson traust...@gmail.com wrote: You always miss out on features coming in new versions, so why get started with anything at anytime ? Exactly. Just get it done and working and ship it, then when that cool new feature comes out you can decide if you still need it, and refactor. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: code coverage tool for manual testing
I don't know any tool which can do that. I've used Selenium and Watir to test GUI, but they are for automated testing too. On 15 dic, 05:17, pankaj pankajbhage...@gmail.com wrote: @eddy exactly On Dec 15, 7:23 am, Eddy Josafat eddyjosa...@gmail.com wrote: I think rcov is to test code executed in automated tests execution. Pankaj, are you looking for a tool that shows the code executed while you are testing your app browsing through it? On 14 dic, 09:01, Andrei Erdoss erd...@gmail.com wrote: rcov? On Sun, Dec 13, 2009 at 11:42 AM, pankaj pankajbhage...@gmail.com wrote: Is there any tool for checking code coverage in manual testing Regards, Pankaj -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2Bunsubscrib e...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- Andrei Erdoss -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Cookie encoding problem
Gurus, I'm new to the rail stuff and didn't find any answer to this on the net: 1. In RoR I set a cookie to a value like /foo/bar (containing slashes and other special chars) 2. In my bowser I see that the value is actually %2Ffoo%2Fbar (URL encoded) 3. This cookie will be received by an app which does not decode the URL encoded value Is there a way to prevent cookie encoding on the RoR/Mongrel side? TIA Steffo -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Twitter rails Plugin
Do you know any good rails plugin for twitter? Thnaks, -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Twitter rails Plugin
I am using this one: http://twitter.rubyforge.org 2009/12/16 Jonhy Pear jonhy.p...@gmail.com Do you know any good rails plugin for twitter? Thnaks, -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- Bruno Grasselli Blog: http://brunograsselli.com.br Twitter: http://twitter.com/grasselli -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
On Tue, Dec 15, 2009 at 11:13 PM, greghauptmann greg.hauptm...@gmail.com wrote: PS. On average each request is about 3000ms to 5000ms when being served by RoR (authlogic/paperclip), as opposed to about 160ms for the same content but put directly under /public. I'm using mongrel. You can get a lot more specifics about what's happening time-wise by installing the NewRelic monitoring plugin (http://newrelic.com/). Highly recommended. -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: rjs replace_html with a partial select box not working
You can but it works just fine when the page loads up or you refresh the whole page. On Wed, Dec 16, 2009 at 5:50 AM, tonypm tonypmar...@hotmail.com wrote: is it that :prompt needs a string ? Tonypm -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Need help...NameError in InteractController#add_to_cart
thanks a bunch Regards and Respects, Kindness in thought leads to wisdom. Kindness in speech leads to eloquence. Kindness in action leads to love. --- On Wed, 12/16/09, Colin Law clan...@googlemail.com wrote: From: Colin Law clan...@googlemail.com Subject: Re: [Rails] Need help...NameError in InteractController#add_to_cart To: rubyonrails-talk@googlegroups.com Date: Wednesday, December 16, 2009, 5:39 AM 2009/12/16 Oluwayomi Oluwadara yomid...@yahoo.com I am following the text agile web development with rails here is my code, There is no point repeatedly posting the same code. As has been pointed out several times the problem is that you are missing the find_cart method. In Agile Development With Rails this is in the StoreController, as has also been pointed out to you previously. I suggest you go back to the book and have another look. I believe you can even download the application source if you wish. Colin -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails documentation generating error
Hi, I tried to generate Rails guides locally using following command rake doc:guides but rake aborats denoting following error message. rake aborted! Missing template credits.erb in view path /opt/local/lib/ruby/gems/1.8/ gems/rails-2.3.5/lib/../guides/rails_guides/../source Also I tried to generate Rails doc using rake doc:rails it also fails. rake aborted! Don't know how to build task 'vendor/rails/railties/CHANGELOG' My Rails version is 2.3.5. Can anyone suggest how can I fix this problem? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
Are you re-checking authentication for each image? Could you find some way to authenticate only once for all of your resources? Perhaps use Basic or Digest authentication for your images, and then somehow tie the password to the current session? If you can remove unnecessary database hits, you may be able to shave off some ms. You may add a few ms for HTTP authentication, though, so I'd take a close look. Are you using a mongrel cluster? If this is all going through one mongrel instance, it's only handling one request at a time. Switching to passenger may help, as it can spawn new instances to handle simultaneous requests (depending on settings and your server's memory). On Dec 16, 8:02 am, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Tue, Dec 15, 2009 at 11:13 PM, greghauptmann greg.hauptm...@gmail.com wrote: PS. On average each request is about 3000ms to 5000ms when being served by RoR (authlogic/paperclip), as opposed to about 160ms for the same content but put directly under /public. I'm using mongrel. You can get a lot more specifics about what's happening time-wise by installing the NewRelic monitoring plugin (http://newrelic.com/). Highly recommended. -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Cucumber + Ajax
I assume you are using Cucumber with webrat. WebRat does not support Ajax, for that, you would need to use Selenium. Check out the Selenium page on the cucumber github wiki for more info. If you need additional help after that, contact me directly and I may be able to help you set it up. Cheers, Marcelo. Em Dec 15, 2009, às 11:55 PM, Abhishek shukla escreveu: Hello Friends. I have a scenario where I am using link_to_remote For a ajax request. Cucmber Script Then I click on Active Steps Then /^I click on ([^\]*)$/ do |click| visit(/controller/some_action/#...@office.id}) end controller def some_action if post.xhr? something end end But When I run the cucumber script I am post.xhr? FALSE But the same I am getting true from browser Can you please help me out Where I am getting worng? thanks abhis -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Error: uninitialized constant MysqlCompat::MysqlRes
If you are still getting this issue, I have posted an EXPLANATION as well as how to derive the correct solution for your system here http://techliberty.blogspot.com/ http://techliberty.blogspot.com/ the EXPLANATION was to long for a forum post :) Adam Akhtar-2 wrote: Anybody still has the issue? I have been using jruby for a while but today I was trying to setup using the last version of ruby 1.9 and rails 2.3.4 and I got hit with that. Also running centos and tried the ARCHFLAGS trick with no success. Pishty Ags wrote: Evan Green wrote: This didn't seem to fix the error for me. I still get 'uninitialized constant MysqlCompat::MysqlRes' Kyle Fox wrote: To fix this, specify ARCHFLAGS when you install the 'mysql' gem: sudo env ARCHFLAGS=-arch x86_64 gem install mysql -- --with-mysql- config=/usr/local/mysql/bin/mysql_config On Aug 27, 12:07�pm, Caleb Cullen cheers, on my Centos Machine, i had to install mysql-devel.x86_64 first, then i ran the command: env ARCHFLAGS=-arch x86_64 gem install mysql -- --with-mysql-config=/usr/lib64/mysql/mysql_config which did the trick. thanks Kyle -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~--- -- View this message in context: http://old.nabble.com/Error%3A-uninitialized-constant-MysqlCompat%3A%3AMysqlRes-tp24761537p26816101.html Sent from the RubyOnRails Users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
Thanks * I'll try new relic then to get some more incite * re authentication I'm using authlogic so in fact after initial authentication it should use session cookies. However authlogic does store sessions in database.. * re number of images etc and mongrel cluster, I'm only testing with one mongrel, however I am here looking at per request stats * re authenticating via apache: if I knew how I could do this, bit have it integrated with my apps user provioning I'd look at this. Any leads here? I couldn't find anything when I looked. Thanks On Dec 17, 4:00 am, sax s...@livinginthepast.org wrote: Are you re-checking authentication for each image? Could you find some way to authenticate only once for all of your resources? Perhaps use Basic or Digest authentication for your images, and then somehow tie the password to the current session? If you can remove unnecessary database hits, you may be able to shave off some ms. You may add a few ms for HTTP authentication, though, so I'd take a close look. Are you using a mongrel cluster? If this is all going through one mongrel instance, it's only handling one request at a time. Switching to passenger may help, as it can spawn new instances to handle simultaneous requests (depending on settings and your server's memory). On Dec 16, 8:02 am, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Tue, Dec 15, 2009 at 11:13 PM, greghauptmann greg.hauptm...@gmail.com wrote: PS. On average each request is about 3000ms to 5000ms when being served by RoR (authlogic/paperclip), as opposed to about 160ms for the same content but put directly under /public. I'm using mongrel. You can get a lot more specifics about what's happening time-wise by installing the NewRelic monitoring plugin (http://newrelic.com/). Highly recommended. -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] EDI
Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.com wrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
Electronic Data Interchange On Thu, Dec 17, 2009 at 2:46 AM, tom tomabr...@gmail.com wrote: EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.com wrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
+1 EDI? Em Dec 16, 2009, às 12:46 PM, tom escreveu: EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.com wrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
EDI = XML, furhtermoew, each document has a unique number and refined fields...all u need is a mapping and maybe something like to_edi maybe a mapping table... On Wed, Dec 16, 2009 at 1:47 PM, dwhitekiss dwhitek...@gmail.com wrote: Electronic Data Interchange On Thu, Dec 17, 2009 at 2:46 AM, tom tomabr...@gmail.com wrote: EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.com wrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
I am an absolute beginner in ROR. How can I start mapping using ROR? On Thu, Dec 17, 2009 at 3:04 AM, tom tomabr...@gmail.com wrote: EDI = XML, furhtermoew, each document has a unique number and refined fields...all u need is a mapping and maybe something like to_edi maybe a mapping table... On Wed, Dec 16, 2009 at 1:47 PM, dwhitekiss dwhitek...@gmail.com wrote: Electronic Data Interchange On Thu, Dec 17, 2009 at 2:46 AM, tom tomabr...@gmail.com wrote: EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.comwrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
1) do u have an running webapplication in RoR? 2) do u know what EDI is? On Wed, Dec 16, 2009 at 2:07 PM, dwhitekiss dwhitek...@gmail.com wrote: I am an absolute beginner in ROR. How can I start mapping using ROR? On Thu, Dec 17, 2009 at 3:04 AM, tom tomabr...@gmail.com wrote: EDI = XML, furhtermoew, each document has a unique number and refined fields...all u need is a mapping and maybe something like to_edi maybe a mapping table... On Wed, Dec 16, 2009 at 1:47 PM, dwhitekiss dwhitek...@gmail.com wrote: Electronic Data Interchange On Thu, Dec 17, 2009 at 2:46 AM, tom tomabr...@gmail.com wrote: EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.comwrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com . To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
Don't think about ROR, think about Ruby, how can you map with Ruby, then adapt it to ROR. Marcelo. Em Dec 16, 2009, às 1:07 PM, dwhitekiss escreveu: I am an absolute beginner in ROR. How can I start mapping using ROR? On Thu, Dec 17, 2009 at 3:04 AM, tom tomabr...@gmail.com wrote: EDI = XML, furhtermoew, each document has a unique number and refined fields...all u need is a mapping and maybe something like to_edi maybe a mapping table... On Wed, Dec 16, 2009 at 1:47 PM, dwhitekiss dwhitek...@gmail.com wrote: Electronic Data Interchange On Thu, Dec 17, 2009 at 2:46 AM, tom tomabr...@gmail.com wrote: EDI? On Wed, Dec 16, 2009 at 1:42 PM, dwhitekiss dwhitek...@gmail.com wrote: Hello, Has any body tried ROR for EDI development? If yes, can I see the resources. If no, where should I start EDI on ROR? D -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en . -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
sure, but the goal is to map lets say a PurchaseOrder (Header + Positions = 2 Models in ActiveRecord (PO_Header + PO_Line)), right? but to to s imple mapping in ruby, yes the first step would be to outline / output in a xml file...would be my route -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
Hi, On Thu, 2009-12-17 at 03:07 +0800, dwhitekiss wrote: I am an absolute beginner in ROR. How can I start mapping using ROR? Assuming you're beyond the 'how do i build a Rails app' level, and assuming that what you're trying to do is limited to building an xml doc rather than implementing an edi transmission protocol library (IIRC, EDI has its own protocol), you may want to start by taking a look at the Builder::XmlMarkup class in the docs (api.rubyonrails.org). If you need additional capabilities, look at REXML. HTH, Bill -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
tried new relic however it requires silver to do a web transaction view, which seems to be a minimum $100 monthly even if I only want to use it for 10 minutes...I bit expensive for a hobbyist programmer who just wants to get time response time log points in to delineate times spent in: rails generic code, authlogic, paperclip, database... I might try to work out how to put logging into these points myself first. Any advice welcome on how/where to put logging code that would: a) be the first bit of rails code hit when the request comes in? b) first point called out to authlogic for authentication (perhaps this is just in the specific controller before the before_filter :require_user line, and one at end point? c) first point for paperclip call (would be just in the controller before teh webfile = Webfile.find_by_path( search_path ) line perhaps)? d) point where all the above calls complete and the streaming of data back to the browser starts (perhaps just in the controller at the send_file webfile.file.path , :type = webfile.file_content_type, :disposition = 'inline' line)? On Dec 17, 4:36 am, greghauptmann greg.hauptm...@gmail.com wrote: Thanks * I'll try new relic then to get some more incite * re authentication I'm using authlogic so in fact after initial authentication it should use session cookies. However authlogic does store sessions in database.. * re number of images etc and mongrel cluster, I'm only testing with one mongrel, however I am here looking at per request stats * re authenticating via apache: if I knew how I could do this, bit have it integrated with my apps user provioning I'd look at this. Any leads here? I couldn't find anything when I looked. Thanks On Dec 17, 4:00 am, sax s...@livinginthepast.org wrote: Are you re-checking authentication for each image? Could you find some way to authenticate only once for all of your resources? Perhaps use Basic or Digest authentication for your images, and then somehow tie the password to the current session? If you can remove unnecessary database hits, you may be able to shave off some ms. You may add a few ms for HTTP authentication, though, so I'd take a close look. Are you using a mongrel cluster? If this is all going through one mongrel instance, it's only handling one request at a time. Switching to passenger may help, as it can spawn new instances to handle simultaneous requests (depending on settings and your server's memory). On Dec 16, 8:02 am, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Tue, Dec 15, 2009 at 11:13 PM, greghauptmann greg.hauptm...@gmail.com wrote: PS. On average each request is about 3000ms to 5000ms when being served by RoR (authlogic/paperclip), as opposed to about 160ms for the same content but put directly under /public. I'm using mongrel. You can get a lot more specifics about what's happening time-wise by installing the NewRelic monitoring plugin (http://newrelic.com/). Highly recommended. -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
On Wed, Dec 16, 2009 at 11:38 AM, greghauptmann greg.hauptm...@gmail.com wrote: tried new relic however it requires silver to do a web transaction view, which seems to be a minimum $100 monthly Mmmm. Haven't been paying attention, apparently their business model has, er, evolved :-) Alternatively, you might want to look at the rails-footnotes gem. HTH, -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???
PS I should say what the free screen did show from a high level point for the call I made was: * average response time broken down by tier * ~40ms Ruby * ~140ms Mongrel wait * ~3ms Database On Dec 17, 5:47 am, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Wed, Dec 16, 2009 at 11:38 AM, greghauptmann greg.hauptm...@gmail.com wrote: tried new relic however it requires silver to do a web transaction view, which seems to be a minimum $100 monthly Mmmm. Haven't been paying attention, apparently their business model has, er, evolved :-) Alternatively, you might want to look at the rails-footnotes gem. HTH, -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] EDI
Bill, are u more familiar with EDI? i mean the various protocols / subsets etc? On Wed, Dec 16, 2009 at 2:25 PM, bill walton bwalton...@gmail.com wrote: Hi, On Thu, 2009-12-17 at 03:07 +0800, dwhitekiss wrote: I am an absolute beginner in ROR. How can I start mapping using ROR? Assuming you're beyond the 'how do i build a Rails app' level, and assuming that what you're trying to do is limited to building an xml doc rather than implementing an edi transmission protocol library (IIRC, EDI has its own protocol), you may want to start by taking a look at the Builder::XmlMarkup class in the docs (api.rubyonrails.org). If you need additional capabilities, look at REXML. HTH, Bill -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Twitter rails Plugin
Thank you. Looks good. On Wed, Dec 16, 2009 at 3:20 PM, Bruno Grasselli bruno.grasse...@gmail.comwrote: I am using this one: http://twitter.rubyforge.org 2009/12/16 Jonhy Pear jonhy.p...@gmail.com Do you know any good rails plugin for twitter? Thnaks, -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- Bruno Grasselli Blog: http://brunograsselli.com.br Twitter: http://twitter.com/grasselli -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. - -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Segmenting databases in environments
We have two environments, sandbox and production, each with it's own main database. However, production will have a separate database called Users that has login/password information, which would be used by the sandbox or production environments to login. If we set it up in our User model to use the Users database (using establish_connection) in the sandbox and production environments, is it possible to still do joins and such through ActiveRecord, not custom sql between the Users database and the main database that is respective to sandbox or production? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Caching comments: timestamps and subdomains
Hi, I'm working on a website that has a very slow loading frontpage. I wanted to start by caching certain elements that have high load. For example, it loads the last 50 comments, along with the corresponding usernames, avatars and more. So I cached that fragment and created a sweeper that observes Comment and expires after every create or destroy action. However, I have two problems: - Every comment has a timestamp that gets displayed like 1 minute ago. When the fragment displaying the last 50 comments is cached, this timestamp gets cached as well. That means that even after 15 minutes, it still says 1 minute ago until another comment is posted. Is there any way to take that bit out of the cached fragment so that it gets updated? Caching these comments saves us about 150 milliseconds, so we really do want to cache it! - When expiring a cached fragment, it sends along the subdomain. This means that when I create a comment at www.domain.com/comment/create, it will expire the cache for www.domain.com, but not for domain.com. I don't want it to store two different cached fragments for www and non- www, as they're exactly the same. I also want both the www and non-www page to expire. Should I do something like cache(:action = '...', :subdomain = false, :action_suffix = '...') and do the same for the expire_fragment part? Or is there a better solution? Thank you! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Caching comments: timestamps and subdomains
- When expiring a cached fragment, it sends along the subdomain. This means that when I create a comment atwww.domain.com/comment/create, it will expire the cache forwww.domain.com, but not for domain.com. I don't want it to store two different cached fragments for www and non- www, as they're exactly the same. I also want both the www and non-www page to expire. Should I do something like cache(:action = '...', :subdomain = false, :action_suffix = '...') and do the same for the expire_fragment part? Or is there a better solution? Sorry. The above doesn't work! Even with :subdomain = false present, it will look for the www-version. Is there another way? Or should I start redirecting all www-requests to domain.com? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Caching comments: timestamps and subdomains
With the first problem, you can do something like this: In the coment render the datetime when they create, like this: *user1 make a coment 2009-12-16 20:44* and with jquery (if you use jquery) you can transform the datetime to time ago format with this library: http://timeago.yarp.com/ Like this the fragment is cached and with javascript make the change. See the library timeago for the datetime format. ___ Agustin Viñao www.agustinvinao.com.ar agustinvinao (Skype) On Wed, Dec 16, 2009 at 7:47 PM, jhaagmans jaap.haagm...@gmail.com wrote: - When expiring a cached fragment, it sends along the subdomain. This means that when I create a comment atwww.domain.com/comment/create, it will expire the cache forwww.domain.com, but not for domain.com. I don't want it to store two different cached fragments for www and non- www, as they're exactly the same. I also want both the www and non-www page to expire. Should I do something like cache(:action = '...', :subdomain = false, :action_suffix = '...') and do the same for the expire_fragment part? Or is there a better solution? Sorry. The above doesn't work! Even with :subdomain = false present, it will look for the www-version. Is there another way? Or should I start redirecting all www-requests to domain.com? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Where is the first point in rails code that a request hits?
Hi, Where is the first point in rails code that a request hits? (I can then add some logging code there as I want to measure some response times) Regards -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Single Table Inheritance in Rails: Sample App Available
Part 3 of the Rails STI post is available now: http://joemcglynn.wordpress.com/2009/12/16/rails-single-table-inheritance-part-iii/ The example source code for part 2 is on github: http://github.com/canonical/Single-Table-Example Cheers, Joe On Dec 12, 4:54 pm, Joe McGlynn joemcglynn...@gmail.com wrote: I'm using Rails STI on a project, so I extracted the basics and wrote up some basics onsingletableinheritance and how it's used in Rails. Two blog posts, first is here:http://joemcglynn.wordpress.com/2009/12/11/rails-sti-part-1/ Second is here:http://joemcglynn.wordpress.com/2009/12/12/rails-single-table-inherit... I put the sample code on my github repository:http://github.com/canonical/Single-Table-Example I plan to write one more segment on STI showing some more advanced scenarios. Cheers, Joe -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] observe_field
I have a select element where the id field of a db table is populated. When I select an id from that select tag I want to show all the related names with that id populated in another select tag element in the same page.please help me. Thanks Regards INDRANIL MUKHERJEE -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Understanding where certain 'inherited' methods come from in ActionController::Base
Hi I just started getting my hands on Rails, I've been reading a good book on the subject but now I want to continue by myself and with the help of the rails api documentation but I find it quite difficult to follow (copared with the Java generated docs for example). One thing that I still can't get to understand is how methods like 'layout' become available on my controllers to mention one example I supposed that the method was defined inside ActionController::Base but reading the docs I see there is no such thing defined there. Can you please clarify on this issue, I believe it may be something related to the Ruby that I still don't know about. Thanks in advance. M. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: How to scrape a page without knowing its html structure
It seems that looking at the structure would be the easiest way, but if you wanted something more complex...your scraping program could infer the layout structure and separate this from the content. Your program would need to be fed multiple pages and would assume the layout to be the portion that stays mostly the same from page to page. That's an oversimplification, but that's the general idea. Good luck. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Barry Flower is out of the office.
I will be out of the office starting 17/12/2009 and will not return until 23/12/2009. I will be accessing my mail from time to time but for urgent issues please contact Kiran Joshi (IT Issues) or Adam Brand (Business Issues) or Elaine Chetty (Project, Planning or Finance Issues). For urgent support please email or call eFX Support (+612 8254 8500) or FX IT Support (+612 8253 1371) I can also be contacted on +61 (0) 439 467 971 for urgent matters. Please consider our environment before printing this email. WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately. It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments. This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision. Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency. Westpac Banking Corporation ABN 33 007 457 141. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.