[Rails] Re: Configuring proper sequence of Rack middlewares ...

2012-11-19 Thread Kedar Mhaswade
The best way to visualize the process here is to imagine the request comes in at the *top* of the middleware stack (AD::Static here) and is passed down to successive middlewares until it generates a response. The response then flows back *up* the stack until it gets to the top and is

[Rails] Configuring proper sequence of Rack middlewares ...

2012-11-05 Thread kedar mhaswade
I am running into a situation where I can't ensure the proper sequence of Rack middlewares. I have two middlewares in my Rails 3.0.9 stack: 1- ExceptionNotifier 2- ActionDispatch::ShowExceptions The first one is a gemhttps://www.ruby-toolbox.com/projects/exception_notificationthat notifies me

[Rails] Handing request.session in Rack Middleware ...

2012-05-03 Thread Kedar Mhaswade
I have been experimenting with providing API for my own Rails 3 app and I implemented the OAuth-provider. With OAuth-provider, access_token is the king. Now, my idea is my users will invoke the API like: GET requests (e.g. for listing the instances of a Comment resource) -- curl

[Rails] has_one association with polymorphic flavor?

2011-08-31 Thread Kedar Mhaswade
I think I understand that only belongs_to association can be polymorphic. The model that carries belongs_to gets the foreign key and :polymorphic = true. But I want to model the following: A User has_one vehicle, which can be either a Car or a Truck, but not both (this is a requirement). My

[Rails] Re: rails.vim - killing the server?

2011-05-15 Thread Kedar Mhaswade
Gordon Mccreight wrote in post #844159: I bumped into this page while looking for the same answer: namely, how do you stop the server when using rails.vim. Since this thread didn't help, I looked into the source code for rails.vim The answer is (notice the minus after the !) :Rserver!-

[Rails] :message with new style validates?

2011-03-19 Thread Kedar Mhaswade
I found some questions posted in this regard in the past, but I couldn't find anything conclusive. Hence this post, with two questions. This is in context of Rails 3.x. 1. Is it recommended (as a matter of style) to use the validates :name, :presence = true instead of more verbose

[Rails] Re: Could not find sqlite3

2011-03-18 Thread Kedar Mhaswade
Carl Jenkins wrote in post #988231: I am trying to get Ruby/Rails running on my mac but having some issues. I created a new rails project blog_test trying to get something working. When I follow this guide http://guides.rubyonrails.org/getting_started.html it says to do a db:create. This

Re: [Rails] Hash to list fails

2011-02-15 Thread kedar mhaswade
Or since only keys are needed, use each_key iterator. Also, I think ri should say that the method each returns the same Hash on which you called the method. -Kedar On Tue, Feb 15, 2011 at 8:57 AM, Colin Law clan...@googlemail.com wrote: On 15 February 2011 16:46, Paul Bergstrom

Re: [Rails] Re: Hash to list fails

2011-02-15 Thread kedar mhaswade
On Tue, Feb 15, 2011 at 10:26 AM, Paul Bergstrom li...@ruby-forum.comwrote: Kedar Mhaswade wrote in post #981823: Or since only keys are needed, use each_key iterator. Also, I think ri should say that the method each returns the same Hash on which you called the method. -Kedar I

Re: [Rails] Re: Hash to list fails

2011-02-15 Thread kedar mhaswade
On Tue, Feb 15, 2011 at 11:20 AM, Paul Bergstrom li...@ruby-forum.comwrote: It works as a ruby script. But not in Rails. Strange. Or rather it works in Rails too. But does not do what you want. No wait, but it does do what you told it to do :-) -Kedar -- Posted via

Re: [Rails] Regex for string first chars - Model validation

2011-02-11 Thread kedar mhaswade
On Fri, Feb 11, 2011 at 11:30 AM, Rodrigo Alves Vieira rodrig...@gmail.comwrote: Hello everyone, in my Rails app I need to validate a string that on creation can not have its first chars empty or composed by any special chars. For example: file and %file aren't valid. Do you know what Regex

[Rails] Understanding the rails control flow better ...

2009-04-23 Thread Kedar Mhaswade
In order to understand exactly when the various model validators are called, I installed ruby-debug and added “debugger” just before say validates_numericality field of a model (say Product). I see that this gets called (debugger break-point is reached) when I am just “Show”ing the products (e.g.

[Rails] Slightly OT: Search for your questions/comments to forum

2009-03-20 Thread Kedar Mhaswade
Sorry if this is rather stupid. I tried doing the due diligence, but could not get an answer. How do you search ruby-forum for your own entries (posts) made? For example, I was looking for a question I had asked related to something and I can't find it now. -Kedar -- Posted via

[Rails] Re: Slightly OT: Search for your questions/comments to forum

2009-03-20 Thread Kedar Mhaswade
Thanks! That helps. I was searching at ruby-forum and thought it would have something similar too. On Mar 20, 10:46 am, Lee Smith rails-mailing-l...@andreas-s.net wrote: Have you tried going to the google group and viewing your profile? http://groups.google.com/group/rubyonrails-talk?hl=en

[Rails] Re: MySQL and RoR 2.2.2 -- deadlock?

2009-01-20 Thread Kedar Mhaswade
I used for OSX 10.5 sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/ mysql_config Hi Eric, Thanks for your help. The problem was that the computer did not have libmysqlclient15-dev package which contains mysql_config. I did the following sudo apt-get install

[Rails] Re: What version of rails am I running?

2009-01-19 Thread Kedar Mhaswade
Kedar Mhaswade wrote: Bobnation wrote: To go one step farther, I would recommend installing RubyGems from source and then installing Rails through RubyGems. Much better situation. On Jan 18, 7:24�pm, Jeremy McAnally jeremymcana...@gmail.com Maybe then http://wiki.rubyonrails.org/rails

[Rails] MySQL and RoR 2.2.2 -- deadlock?

2009-01-19 Thread Kedar Mhaswade
Note: Serious criticism follows since I want to see rails improve. - I was a happy camper getting along well with introducing myself with RoR 2.2.2 when disaster struck and I think I am not alone (a Google search indicates so). So,

[Rails] What version of rails am I running?

2009-01-18 Thread Kedar Mhaswade
Sorry to ask a question that appears like the one posed by a n00b. (Maybe I am going blind, seriously). I have searched the forum for it, but couldn't find it. How can I tell which version of rails I am running? Doing rails -v fails. That's another question -- why does it fail -- why can't it

[Rails] Re: What version of rails am I running?

2009-01-18 Thread Kedar Mhaswade
Frederick Cheung wrote: On 19 Jan 2009, at 00:24, Kedar Mhaswade wrote: In what way does it fail ? That aside, rails -v tells you what the latest version of rails on your computer is, which isn't the same thing as what version your rails apps are running. That can be controlled

[Rails] Re: What version of rails am I running?

2009-01-18 Thread Kedar Mhaswade
Bobnation wrote: To go one step farther, I would recommend installing RubyGems from source and then installing Rails through RubyGems. Much better situation. On Jan 18, 7:24�pm, Jeremy McAnally jeremymcana...@gmail.com Maybe then http://wiki.rubyonrails.org/rails/pages/Installation should