我使用CSS创建了下拉菜单,我在导航栏下方的框中放置了一个YouTube视频.使用IE 8时,下拉菜单落后于YouTube视频,尽管带有导航栏的div具有比带有YouTube视频的div更高的z-index.Firefox,Safari或IE9中不存在此问题.
您可以通过访问该网站来查看问题:
http://www.mensdiscipleshipnetwork.com
谢谢您的帮助.
我正在尝试创建一个简单的链接,单击该链接会启动与特定资源关联的文档的下载.我有一个资源模型,在该模型中有一个名为"document"的列.我可以在单击链接时成功查看文档内联,但我更愿意下载它.我一直在阅读有关内容类型和send_file的内容,但我还没有能够将它们完全拼凑起来以实现功能.
这是我认为我需要用于链接的代码:
<%= link_to 'Download File', :action => "download_file" %>
这会抛出一个错误:
ResourcesController中的ActiveRecord :: RecordNotFound#show无法找到id = download_file的资源
当我更改链接时,它会在浏览器中打开文件:
<%= link_to 'Open file', resource.document_url, :target => "_blank" %>
在我的ResourcesController中,我定义了这个方法:
def download_file
@resource = Resource.find(params[:id])
send_file(@resource.file.path,
:filename => @resource.file.name,
:type => @resource.file.content_type,
:disposition => 'attachment',
:url_based_filename => true)
end
Run Code Online (Sandbox Code Playgroud)
我在routes.rb中设置了一条路由,如下所示:
resources :resources do
get 'resources', :on => :collection
end
Run Code Online (Sandbox Code Playgroud)
因此,基于此错误,似乎我在ResourcesController中的download_file方法无法确定与文档关联的资源记录的ID.
我正在运行:Rails 3.2.11 Carrierwave 0.8.0 Ruby 1.9.3-p194
我希望对此有所了解.我搜索了很多文章,但却找不到简单的教程.谢谢.
我有一个RoR Web应用程序,我正在尝试使用Apache上的Passenger.奇怪的是,如果我使用Passenger Standalone,我可以访问Web应用程序,但我似乎无法使用带有Passenger模块的Apache访问Web应用程序.
乘客模块似乎正在运行,因为我可以启动Apache而没有错误,并且Passenger-status返回以下内容:
----------- General information -----------
max = 6
count = 0
active = 0
inactive = 0
Waiting on global queue: 0
----------- Application groups -----------
Run Code Online (Sandbox Code Playgroud)
当我尝试访问Web应用程序时,我获得了公用文件夹目录的列表.
这是我的虚拟主机文件:
<VirtualHost *:80>
ServerAdmin smith@example.com
DocumentRoot /home/smith/www/dashboard/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/smith/www/dashboard/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我在apache2.conf文件的末尾有以下内容: …
我正在创建一个自定义视图,稍微修改一下index.html.erb.我希望能够在我的网络应用程序上创建一个链接,用于指导用户调用此自定义视图list.html.erb.
这就是我所做的:
1)复制默认的脚手架索引视图并将其重命名为list.html.erb
2)GalleriesController通过复制index方法并重命名为list:
def list
@galleries = Gallery.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @galleries }
end
end
Run Code Online (Sandbox Code Playgroud)
3)修改后的routes.rb文件如下:
match "galleries/list" => "galleries#list"
Run Code Online (Sandbox Code Playgroud)
我一直收到以下错误:
Couldn't find Gallery with ID=list
Rails.root: /Users/scervera/Sites/MDN
Application Trace | Framework Trace | Full Trace
app/controllers/galleries_controller.rb:28:in `show'
Run Code Online (Sandbox Code Playgroud)
在我对stackoverflow的搜索中,我无法找到任何类似的问题.