Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanna doesn't work with MobileFu #5

Open
forsakenquantum opened this issue Oct 28, 2011 · 2 comments
Open

Vanna doesn't work with MobileFu #5

forsakenquantum opened this issue Oct 28, 2011 · 2 comments

Comments

@forsakenquantum
Copy link

When using MobileFu, in a controller that inherits from VannaController instead of ApplicationController, mobile views don't show up when you navigate to the appropriate page with a mobile device, even though index.mobile.haml exists. What you get instead is a dump of the raw output of the index method of the controller for that page. The regular version (in index.html.haml) shows up just fine.

The instructions for MobileFu say to put the line "has_mobile_fu" in your application controller. If you put that line in the vanna controller instead, you get the error described above. If you copy and paste the contents of has_mobile_fu into the vanna controller, but delete the line "before_filter :set_request_format if set_request_format" then the mobile view works, but it shows the regular view. The set_request_format sets request.format to :mobile instead of :html, so that action is what seems to break the view.

@forsakenquantum
Copy link
Author

In my example I mentioned a .haml file, but it looks like it doesn't work with .erb either

@MikeSofaer
Copy link
Owner

Hi,

I'm not very familiar with MobileFu so I'm just guessing here, but if you want to switch on a :mobile format type, you can probably do that by adding a post-process block for mobile. There are a couple files that add post-process blocks for default redirects, etc, and you can probably write a Vanna plugin that enables MobileFu that way.

You can also use client-side rendering for VannaController pages. Any URL that serves HTML from a Vanna controller can serve the JSON needed to build it, Vanna is designed around it being very easy to transition to a Javascript MVC strategy for a given page.

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

No branches or pull requests

2 participants