Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Request format issue with iPad (iPhone working properly) #7

Closed
dgilperez opened this issue Mar 23, 2012 · 9 comments
Closed

Request format issue with iPad (iPhone working properly) #7

dgilperez opened this issue Mar 23, 2012 · 9 comments

Comments

@dgilperez
Copy link

Hi !

We're using mobylette to handle our mobile device requests under Rails 3.2.2, ruby 1.9.2 app. In our ApplicationController:

  respond_to_mobile_requests :fall_back => :html

It seems mobylette is failing to fallback views for iPads, while properly behaving with iPhones. Here is the error message for a failing iPad request:

ActionView::MissingTemplate: Missing template invitation_requests/new, application/new with {:locale=>[:es], :formats=>[:mobile], :handlers=>[:erb, :builder, :haml]}. Searched in: * "/app/app/views" * "/app/vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/app/views" 

I see a formats => [:mobile] that I guess should include html as well ... just thinking out loud.

Any ideas?

@dgilperez
Copy link
Author

One step forward: actions not working are only those where a respond_with @object were used.

@tscolari
Copy link
Owner

hummm
I will give a look on this here, probably it's something I missed when working with responders

@tscolari
Copy link
Owner

Hello, sorry for the delay to getting back to you.
Did you solve this?

I tryed a lot, but I could not reproduce this error.
Could you supply me a sample application where it occurs?
or give me more info about how do you configured responders in the controller?

I've even refactored gems internals and specs, but could not find anything related.

@tscolari
Copy link
Owner

I released a new version with improvements in the user_agent list, ipad was included.
I don't think it would cause any problem related to fall_back, but it's worth updating.

Just be aware that after version 2.0 the method respond_to_mobile_requests' doesn't exists anymore, you must use theinclude Mobylette::RespondToMobileRequestsand themobylette_config` instead.

@dgilperez
Copy link
Author

Hi tscolari !

I just rewrote that part of my app not to use respond_with ... and development went so much further I'm not able to reproduce it anymore.

Anyway I'm upgrading and pinging back if any issues.

I just realized I had this piece of code in an initializer. I was not the one who put this in place, nor why is it there. It might be related:

ActionController::Responder.class_eval do
  alias :to_mobile :to_html
end

I'll comment that out and tell if something interesting is found.

Regards!

BTW, there's a typo in the README: Mobyllete per Mobylette.

@tscolari
Copy link
Owner

ups, I've fixed the typo!

You got me with that initializer. There is one of those inside the gem too.
I remember it was something related to responders, but I've no memory of what exactly. I'll give a look at this.

@tscolari
Copy link
Owner

Please give the version 3.0 a try, there was some internal changes in the resolvers.
I'm closing all the resolver related issues before 3.0.

@dgilperez
Copy link
Author

New version works great for me, thanks !!!

@tscolari
Copy link
Owner

That's great to hear!

Sent via Hubroid

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants