html的文件怎么查看,如何查看扩展名为.html.haml的文件的输出

请帮助我,我正在开发一个rails项目,并创建了一个扩展名为.html.haml的视图文件,但现在当我试图查看该文件的输出会给出错误。是否有任何其他方法来查看这种扩展名的文件,我使用的方式,因为我用exyension.html.erb查看我的文件。我在控制器nd中创建了一个动作,并匹配routes.rb中的路径。请帮助我,提前致谢。

我的routes.rb文件如何查看扩展名为.html.haml的文件的输出

PretAChef::Application.routes.draw do

# mount FeatherCms::Engine => "/feathers"

# get 'pages/:name' => 'feather_cms/pages#published', :as => 'feather_published_page'

resources :messages, only: [:destroy, :show] do

member do

post :reply

get :mark_read

end

end

resources :bookings, only: [] do

resources :messages, only: [:new, :create]

end

resources :chefs, :only => [:index, :show] do

member do

get :feedbacks

end

end

resources :customers, :only => [] do

member do

get :feedbacks

end

end

resources :ingredients, only: [:index]

resources :cuisines, only: [:index]

resources :home do

collection do

post :contact

end

end

root :to => 'home#index'

match 'contact_us' => 'home#contact_us', :as => :contact_us

match 'mypop' => 'chefs#mypop', :as => :mypop

devise_for :users, :controllers => {:registrations => "users/registrations", :sessions => "users/sessions", :passwords => "users/passwords", :confirmations => "users/confirmations", :omniauth_callbacks => "users/omniauth_callbacks" }

devise_scope :user do

match "/chef/sign_up" => "users/registrations#new_chef", as: :chef_sign_up

match "/chef/sign_in" => "users/sessions#new_chef", as: :chef_sign_in

match "https://stackoverflow.com/users/sign_out" => "users/sessions#destroy", as: :sign_out

end

resource :profiles, :only => [:edit, :update] do

end

namespace :customer do

resource :dashboards, only: [:show]

resources :bookings, :only => [:create, :update, :edit, :destroy] do

collection do

get :booking_confirmation

get :book_chef

end

member do

# TODO: WTF: use destroy for cancelation

post :rate

post :comment

get :feedback

get :pay

get :complete

get :confirm

end

end

end

namespace :admin do

resources :messages, only: [:index, :show] do

collection do

get :contact_us

get :messages

end

end

resources :cuisines, except: [:show]

resources :bookings, only: [:index, :update, :edit, :destroy]

resources :users, only: [:index, :update, :edit] do

collection do

get :active

get :pending

end

resources :menus, except: [:index] do

collection do

post :preview

get :destory_dish_image

end

end

resources :availabilities, only: [:create, :destroy]

resources :chef_messages, only: [:destroy, :show, :index, :new, :create] do

member do

post :reply

get :mark_read

end

end

namespace :chef do

resources :bookings, only: [:edit, :update] do

member do

get :accept

post :rate

post :comment

get :feedback

end

end

end

end

resources :searches, only: [:index] do

collection do

get "user"

end

end

end

namespace :chef do

resources :bookings, only: [:edit, :update] do

member do

get :accept

post :rate

post :comment

get :feedback

end

end

resource :dashboards, only: [:show]

resources :menus, except: [:index] do

collection do

post :preview

get :destory_dish_image

end

end

resources :availabilities, only: [:create, :destroy]

end

# The priority is based upon order of creation:

# first created -> highest priority.

# Sample of regular route:

# match 'products/:id' => 'catalog#view'

# Keep in mind you can assign values other than :controller and :action

# Sample of named route:

# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase

# This route can be invoked with purchase_url(:id => product.id)

# Sample resource route (maps HTTP verbs to controller actions automatically):

# resources :products

# Sample resource route with options:

# resources :products do

# member do

# get 'short'

# post 'toggle'

# end

#

# collection do

# get 'sold'

# end

# end

# Sample resource route with sub-resources:

# resources :products do

# resources :comments, :sales

# resource :seller

# end

# Sample resource route with more complex sub-resources

# resources :products do

# resources :comments

# resources :sales do

# get 'recent', :on => :collection

# end

# end

# Sample resource route within a namespace:

# namespace :admin do

# # Directs /admin/products/* to Admin::ProductsController

# # (app/controllers/admin/products_controller.rb)

# resources :products

# end

# You can have the root of your site routed with "root"

# just remember to delete public/index.html.

# root :to => 'welcome#index'

# See how all your routes lay out with "rake routes"

# This is a legacy wild controller route that's not recommended for RESTful applications.

# Note: This route will make all actions in every controller accessible via GET requests.

# match ':controller(/:action(/:id))(.:format)'

end

和我的观点文件

!!!

%html

%head

:css

/* popup_box DIV-Styles*/

#popup_box {

display:none; /* Hide the DIV */

position:fixed;

_position:absolute; /* hack for internet explorer 6 */

height:300px;

width:600px;

background:#FFFFFF;

left: 300px;

top: 150px;

z-index:100; /* Layering (on-top of others), if you have lots of layers: I just maximized, you can change it yourself */

margin-left: 15px;

/* additional features, can be omitted */

border:2px solid #ff0000;

padding:15px;

font-size:15px;

-moz-box-shadow: 0 0 5px #ff0000;

-webkit-box-shadow: 0 0 5px #ff0000;

box-shadow: 0 0 5px #ff0000;

}

#container {

background: #d2d2d2; /*Sample*/

width:100%;

height:100%;

}

a{

cursor: pointer;

text-decoration:none;

}

/* This is for the positioning of the Close Link */

#popupBoxClose {

font-size:20px;

line-height:15px;

right:5px;

top:5px;

position:absolute;

color:#6fa5e2;

font-weight:500;

}

%title Popup Box DIV

%script{src: "http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js", type: "text/javascript"}

:javascript

$(document).ready(function() {

// When site loaded, load the Popupbox First

loadPopupBox();

$('#popupBoxClose').click(function() {

unloadPopupBox();

});

$('#container').click(function() {

unloadPopupBox();

});

function unloadPopupBox() { // TO Unload the Popupbox

$('#popup_box').fadeOut("slow");

$("#container").css({ // this is just for style

"opacity": "1"

});

}

function loadPopupBox() { // To Load the Popupbox

$('#popup_box').fadeIn("slow");

$("#container").css({ // this is just for style

"opacity": "0.3"

});

}

});

%body

#popup_box

/OUR PopupBox DIV

%h1 This IS A Cool PopUp

%a#popupBoxClose Close

#container

/Main Page

%h1 sample

,我的行动是厨师控制器mypop。

+0

什么是错误? –

+0

@RajeshKolappakam问题是我试图将它发送到我已经定义的动作来显示我的haml文件bt,而不是去那个方法它是去控制器的其他方法,并显示错误。请告诉我应该怎么做。 –

+0

你可以发布你的'routes.rb'文件 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值