在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Javascript html.erb <!-- 本地目录(public) --> html <script src='/javascripts/main.js' type="text/javascript"></script> CSS html.erb <%= stylesheet_link_tag "main","/photos/columns" %> html <link href="/stylesheets/main.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/stylesheets/photos/columns.css" media="screen" rel="stylesheet" type="text/css" /> Image html.erb # public/images/header.png Video html.erb # public/videos/movie.ogg <%= video_tag "movie.ogg" %> # :poster => 'image_name.png', provides an image to put in place of the video before it starts playing. # :autoplay => true, starts playing the video on page load. # :loop => true, loops the video once it gets to the end. # :controls => true, provides browser supplied controls for the user to interact with the video. # :autobuffer => true, the video will pre load the file for the user on page load. <%= video_tag ["trailer.ogg", "movie.ogg"] %> html <video src="/videos/movie.ogg" /> <video><source src="trailer.ogg" /><source src="movie.ogg" /></video> Audio html.erb # public/audios/ <%= audio_tag "music.mp3" %> <%= audio_tag "music/first_song.mp3" %> # :autoplay => true, starts playing the audio on page load # :controls => true, provides browser supplied controls for the user to interact with the audio. # :autobuffer => true, the audio will pre load the file for the user on page load
Render html.erb # 模板所在目录/_menu.html.erb <%= render "menu" %> # app/views/shared/_menu.html.erb <%= render "shared/menu" %> # ./_link_area.html.erb # /layouts/_graybar.html.erb <%= render :partial => "link_area", :layout => "graybar" %> 传参 new.html.erb <h1>New zone</h1> <%= error_messages_for :zone %> <%= render :partial => "form", :locals => { :zone => @zone } %> edit.html.erb <h1>Editing zone</h1> <%= error_messages_for :zone %> <%= render :partial => "form", :locals => { :zone => @zone } %> _form.html.erb <%= form_for(zone) do |f| %> <p> <b>Zone name</b><br /> <%= f.text_field :name %> </p> <p> <%= f.submit %> </p> <% end %> Rendering Collections index.html.erb <h1>Products</h1> <%= render :partial => "product", :collection => @products %> _product.html.erb <p>Product Name: <%= product.name %></p> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论