Facebox 和导轨无法正常工作!
我正在尝试将 Facebox 与 Rails 一起使用,但它根本不起作用。
我已将所有文件添加到正确的位置:
- 安装 FaceboxRender gem 安装 FaceboxRender
- 下载 jQuery
- 在 https://github 处下载 Facebox。 com/defunkt/facebox
- 将facebox js 文件复制到/public/javascripts/
- 将facebox css 文件复制到/public/styleshees/
- 将facebox 所有图像文件复制到/public/facebox/
- 更新布局的
stylesheet_link_tag
和javascript_include_tag
添加这些 js、css 文件
我已将 FaceboxRender 包含在我的应用程序控制器中,
我在这里缺少什么,
这是一个仅用于测试的链接:
<%= facebox_link_to 'Posts', posts_path %>
错误:
can't convert Symbol into String
Extracted source (around line #1):
1: <li><%= facebox_link_to 'Posts', posts_path %></li>
2:
3:
4: <% @photos.each do |photo| %>
我尝试添加 config.gem "facebox-render"
到我的 config/environment.rb 但我只是收到错误!
虽然我已经安装了 gem, 我运行 rake gems:install 安装时没有遇到任何问题,但是当我
rake db:migrate
时出现此错误:
Missing these required gems:
facebox-render
You're running:
ruby 1.8.7.174 at /opt/local/bin/ruby
rubygems 1.3.6 at /Users/Mister/.gem/ruby/1.8, /opt/local/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
任何帮助都会很棒!
谢谢丹
Am trying to use Facebox with rails, it's not working at all.
I have added all files to there right places:
- Install FaceboxRender gem install FaceboxRender
- Download jQuery
- Download facebox at https://github.com/defunkt/facebox
- Copy facebox js file to /public/javascripts/
- Copy facebox css file to /public/styleshees/
- Copy facebox all image files to /public/facebox/
- Update your layout’s
stylesheet_link_tag
andjavascript_include_tag
to add these js, css files
I have included FaceboxRender in my application controller
what am I missing here
this is a link am using just to test things:
<%= facebox_link_to 'Posts', posts_path %>
error:
can't convert Symbol into String
Extracted source (around line #1):
1: <li><%= facebox_link_to 'Posts', posts_path %></li>
2:
3:
4: <% @photos.each do |photo| %>
I've tried adding config.gem "facebox-render"
to my config/environment.rb
but i just get errors!
Although I have installed the gem already,
I ran rake gems:install I get no problems as it's installed, but when I
rake db:migrate
I get this error:
Missing these required gems:
facebox-render
You're running:
ruby 1.8.7.174 at /opt/local/bin/ruby
rubygems 1.3.6 at /Users/Mister/.gem/ruby/1.8, /opt/local/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
Any help will be great!
Thanks
Dan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1.在 Gemfile 中包含
gem 'facebox-rails'
2.运行
捆绑安装
3.粘贴到您的application.js
4.在您的
视图
中,例如something.html.haml(如果您使用erb,只需添加<% %>)只需添加1.include
gem 'facebox-rails'
in the Gemfile2.run
bundle install
3.paste to your application.js
4. in your
view
like something.html.haml ( if you use erb just add <% %>) just add问题是这一行: 1:
将 posts_path 更改为旧样式:
The issue is this line: 1:
Change posts_path to the old style: