Luke Pearce wrote:
> Raimon Fs wrote:
>>
>> respond_to do |format|
>> format.iphone # action.iphone.erb
>> format.html # index.html.erb
>> format.xml { render :xml => @scanns }
>
>
> It may require someone else to answer this properly however I think you
> are getting confused about what will actually happen:
>
> The iphone will always receive the html pages because the
> webserver/rails app by default will look for html pages.
>
> for example:
>
> 1) http://www.mysite.com/ #=> deafult format.html
> 2) http://www.mysite.com/index.xml #=> format.xml
> 3) http://www.mysite.com/index.iphone #=> format.iphone
>
> Perhaps you could change default route to point to index.iphone when you
> use your subdomain. You'd then need to ensure all your links used the
> .iphone extension.
>
> Unless there is someway to force the default format from html to
> 'iphone'? Wouldn't surprise me if it was possible, however, you'd need
> to look it up...
>
> Cheers
> Luke
Hello,
Do you mean to always use for example an iphone as an extension ?
Then I would to add some special route, don't ?
And in the controller, split the actions:
index
index_iphone
but this approach forces to have duplicate methods, for example fetching
the same data in two different places, I can't follow the DRY. I know at
least I must have differents views ...
If the respond_to and format would work, it would be great .....
anyone know if this is possible ?
thanks!
r.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---