how to rest my app to support mobile phone
-
22-09-2019 - |
문제
I am now going to develop a mobile website both support common html format page and wml format page(Because now a usual web browser on mobile can view html page and some old mobiles only support wml )
First step:
register content type for wml page
config/initializers/mime_types.rb
Mime::Type.register_alias "text/vnd.wap.wml", :wml
Second: Create two format page for an action in view:
class WelcomeController < ApplicationController
def index
@latest_on_sale_auctions = Auction.latest(15)
respond_to do |format|
format.html
format.wml
end
end
end
It works well as I visit: http://localhost:3000/welcome But got: Routing Error No route matches "/welcome.wml" with {:method=>:get} as I visit:http://localhost:3000/welcome.wml
and it works well as I visit:http://localhost:3000/welcome?format=wml
my config/routes.rb like this:
ActionController::Routing::Routes.draw do |map|
map.root :controller => "welcome"
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
My rails version is 2.3.5,please help me, I want a restful app,both support html and wml.
해결책
는 Google과 묻는 것 같습니다 ...
언어 중립 솔루션 패키지를 찾을 수 없습니다
이 문제를 해결하려고 할 수있는 몇 가지 사항이 있습니다. 특정 순서 :
Visual Studio 솔루션을 닫고 완전히 종료 한 다음 다시 실행하고 컴파일하십시오. 때로는 문제를 해결합니다.
Visual Studio 솔루션을 마우스 오른쪽 버튼으로 클릭하고 "Clean"솔루션을 선택한 다음 SharePoint 프로젝트를 마우스 오른쪽 단추로 클릭하고 "Retract"를 선택하십시오. 재구성 및 배포.
관리자가 제거하는 것으로 실행되는 PowerShell에서
- UNISTALL-SPSolutive -Itentity {WSP 파일의 이름} -allWebApplications
관리자가 remove-spsolution로 실행되는 PowerShell에서 :
- remove-spsolution -identity {WSP 파일 이름} --force
관리자로 실행중인 PowerShell에서 삭제 () 명령을 실행합니다.
- (WSP 파일의 이름). 삭제 ()
항목 1 ~ 4가 해결되지 않으면 항목 5는 확실히 수행 할 것입니다 트릭,하지만 다른 모든 솔루션이 실패하지 않으면 실행해서는 안됩니다.
참고 : 백업을 삭제하기 전에!