I''ve got a working app at mysite.com and trying to add
iphone.mysite.com - problem is that I get the classic "Application
error - Rails application failed to start properly" and I don''t
see
anything new in while tailing my log/development.log file. Any ideas
where else I can look or what could be wrong?
Here is what is in my controllers/application.rb...
before_filter :detect_request
def detect_request
request.format = :iphone if iphone_request?
request.format = :mobi if mobile_request?
end
def iphone_request?
request.subdomains.first == "iphone"
end
def mobile_request?
request.subdomains.first == "m"
end
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
if the application isnt starting it probably isnt a controller, most likely something funky in your initializer (config/envrionment.rb) or your actual environment file (config/environments/development.rb) or possibly in a plugin you recently added. have you changed anything in those 3 locations recently? On Sep 24, 11:04 pm, Sav <savar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve got a working app at mysite.com and trying to add > iphone.mysite.com - problem is that I get the classic "Application > error - Rails application failed to start properly" and I don''t see > anything new in while tailing my log/development.log file. Any ideas > where else I can look or what could be wrong? > > Here is what is in my controllers/application.rb... > > before_filter :detect_request > > def detect_request > request.format = :iphone if iphone_request? > request.format = :mobi if mobile_request? > end > > def iphone_request? > request.subdomains.first == "iphone" > end > > def mobile_request? > request.subdomains.first == "m" > end--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The only thing I change is that before_filter :detect_request
Detecting the browser''s user agent works (see below), but detecting
subdomains does not.
def iphone_request?
# Mobile Safari
request.env["HTTP_USER_AGENT"] &&
request.env["HTTP_USER_AGENT"][/
(Mobile\/.+Safari)/]
end
On Sep 24, 9:31 pm, Andrew Bloom
<akbl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> if the application isnt starting it probably isnt a controller, most
> likely something funky in your initializer (config/envrionment.rb) or
> your actual environment file (config/environments/development.rb) or
> possibly in a plugin you recently added. have you changed anything in
> those 3 locations recently?
>
> On Sep 24, 11:04 pm, Sav
<savar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > I''ve got a working app at mysite.com and trying to add
> > iphone.mysite.com - problem is that I get the classic
"Application
> > error - Rails application failed to start properly" and I
don''t see
> > anything new in while tailing my log/development.log file. Any ideas
> > where else I can look or what could be wrong?
>
> > Here is what is in my controllers/application.rb...
>
> > before_filter :detect_request
>
> > def detect_request
> > request.format = :iphone if iphone_request?
> > request.format = :mobi if mobile_request?
> > end
>
> > def iphone_request?
> > request.subdomains.first == "iphone"
> > end
>
> > def mobile_request?
> > request.subdomains.first == "m"
> > end
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---