No one knows why this is happening? I created a new rails app from
scratch, first uncommenting "Mime::Type.register_alias "text/
html", :iphone" in mime_types.rb. Then I put this in my application
controller:

--------
before_filter :adjust_for_iphone

def adjust_for_iphone
   request.format = :iphone if request.env['HTTP_USER_AGENT'][/(Mobile
\/.+Safari)/]
end
--------

I created an index controller, with an index and test action
(index.html.erb, index.iphone.erb, test.js.rjs), and put a remote link
in the index action to call test. Without any respond_to block in the
test action, I get this:

--------
ActionView::MissingTemplate (Missing template index/test.erb in view
path app/views)
--------

When this block is added to the test action:

--------
respond_to do |format|
   format.js
   format.iphone { render 'test.js.rjs' } # also tried without this
render block
end
--------

There are no errors whatsoever, however the rjs doesn't get executed
at all, even with Firebug showing the js in the response. Surely
someone can help with this?

On Apr 3, 4:01 pm, Andrew <[email protected]> wrote:
> I have an iPhone version of my site, and for some reason none of the
> rjs works when viewing the iPhone version. This happens instead:
>
> ActionView::MissingTemplate (Missing template controller_name/
> update.erb in view path app/views)
>
> The rjs works fine when viewing the site normally, and it worked when
> viewing the iPhone version prior to upgrading Rails to 2.3.2.
>
> Additional info: I have 'Mime::Type.register_alias "text/
> html", :iphone' in mime_types.rb and the respond_to block in the
> action is what'd you expect --
>
> respond_to do |format|
>    format.js
> end
>
> What could be the problem? 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to