小编Jon*_*han的帖子

部署到Heroku时出错(DEPRECATION警告:您在供应商/插件中有Rails 2.3样式的插件)

尝试推送到Heroku时出现以下错误.它适用于localhost:3000并且不确定从哪里开始.我删除了vendor/plugins中的文件(在localhost上工作),但在尝试上传到Heroku时仍然产生了同样的错误.

C:\basecode>heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.9170
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support
for these plugins will be removed in Rails 4.0. Move them out and bundle them i
n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial
izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr
ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required
)> at /app/Rakefile:4)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails heroku

2
推荐指数
1
解决办法
2026
查看次数

ruby on rails搜索表单

我是RoR的新手,我设法制作了一个基本的搜索表单,但在尝试扩展搜索标签(名称)时不断出现错误.我有一个包含各种数据的模型(位置,网站,电子邮件,电话)和我想知道如何将这些添加到我当前的搜索代码中.

/models/ciir.rb

def self.search(search)
  if search
    find(:all, :conditions => ['name LIKE ?', "%#{search}%"])
  else
    find(:all)
  end
end
Run Code Online (Sandbox Code Playgroud)

static_pages_controller.rb

def home
  @ciirs = Ciir.search(params[:search])
end
Run Code Online (Sandbox Code Playgroud)

/home.html.erb

<%= form_tag ciirs_path, :method => 'get' do %>
  <p>
    <%= text_field_tag :search, params[:search] %>
    <%= submit_tag " Search Database Records ", :name => nil %>
  </p>
<% end %>
Run Code Online (Sandbox Code Playgroud)

点击提交按钮(没有搜索字词)时,网址为:

ciirs?utf8=?&search=
Run Code Online (Sandbox Code Playgroud)

但是当将名称条件修改为类似"网站"的内容时,网址会更改为

ciirs?utf8=?&search=&commit=+Search+Database+Records+ –
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails

1
推荐指数
1
解决办法
5762
查看次数

标签 统计

ruby ×2

ruby-on-rails ×2

heroku ×1