首页
\
问答
\
使用Sunspot Solr Rails 3搜索多个模型时出错(Error searching multiple models with Sunspot Solr Rails 3)
使用Sunspot Solr Rails 3搜索多个模型时出错(Error searching multiple models with Sunspot Solr Rails 3)
最后在搜索单个模型时让Sunspot工作,但在搜索多个模型时遇到了一些问题。
我在搜索后得到的错误:
Missing template search/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/Indokathan/code/iibfy/app/views" * "/usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.4.1/app/views"
search.rb
class Search < ActiveRecord::Base attr_accessible :title searchable do text :title end end
search_controller.rb
class SearchController < ApplicationController def index @search = Sunspot.search [Dairy, Drink] do fulltext params[:search] end @results = @search.results end end
searchbar.html.erb
<%= form_tag search_index_path, :method => :get do %> <p> <%= text_field_tag :search, params[:search], style:"width:550px; height:30px;" %><br> <%= submit_tag "Search!", :name => nil, class: "btn btn-primary btn-lg", style: "margin-top:10px" %> </p>
任何有关我为什么会收到此错误的帮助都将不胜感激。 如果您需要更多信息,请告诉我。
Finally got Sunspot working when searching a single model, but running into some problems when searching multiple.
The error that I'm getting after making a search:
Missing template search/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/Indokathan/code/iibfy/app/views" * "/usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.4.1/app/views"
search.rb
class Search < ActiveRecord::Base attr_accessible :title searchable do text :title end end
search_controller.rb
class SearchController < ApplicationController def index @search = Sunspot.search [Dairy, Drink] do fulltext params[:search] end @results = @search.results end end
searchbar.html.erb
<%= form_tag search_index_path, :method => :get do %> <p> <%= text_field_tag :search, params[:search], style:"width:550px; height:30px;" %><br> <%= submit_tag "Search!", :name => nil, class: "btn btn-primary btn-lg", style: "margin-top:10px" %> </p>
Any help as to why I am getting this error would be more than appreciated. If you need any more info please let me know.
原文:https://stackoverflow.com/questions/29245979
更新时间:2022-10-14 09:10
最满意答案
table { table-layout: fixed; }
固定桌子为我解决了它。
编辑 :似乎我太晚了!
table { table-layout: fixed; }
Making the table fixed solved it for me.
Edit: seems I'm a few seconds too late!
相关问答
更多-
CSS overflow-x:visible;(CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue)[2023-05-15]
经过一番认真的搜索,似乎我已经找到了我的问题的答案: 来自: http : //www.brunildo.org/test/Overflowxy2.html 在Gecko,Safari,Opera中,'visible'也与'hidden'组合(换句话说:当与'visible'不同的任何东西结合使用时,'visible'变为'auto')变成'auto'。 Gecko 1.8,Safari 3,Opera 9.5都非常一致。 W3C规范也说: “overflow-x”和“overflow-y”的计算值与它们的 ... -
要在文本溢出表单元素时使用省略号剪裁文本,则需要在每个td类上设置max-width CSS属性,以使溢出工作。 不需要额外的布局div td { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } 对于响应布局; 使用max-width CSS属性来指定列的有效最小宽度,或者使用max-width: 0; 无限灵活。 此外,包含表将需要一个特定的宽度,通常w ...
-
块级元素填充overflow-x:scroll容器的100%宽度(Have block level element fill 100% width of overflow-x: scroll container)[2023-07-06]
H1将继承它的父元素的宽度,因为它是相对的,所以它总是会以与#one所设置的宽度相同的宽度结束。 你可以做的是代替#one overflow: auto ,将表格#one另一个DIV overflow: auto 。 这样, #one保持一个固定的宽度,但是围绕桌子的包装,允许内容水平滚动。 jsfiddle: http : //jsfiddle.net/yetti/Ggua5/ The H1 is going to inherit the width of its parent element since ... -
我为您提供了CSS和JS解决方案,它也适用于窗口调整大小。 它不漂亮(但你问的不是!:P) 要使用overflow-x ,您需要设置固定width 。 只需在菜单td中添加一个类,例如
(仅用于更好的定位)。 现在在CSS上添加: td.menu { overflow-x: auto; } 使用JS,您现在可以获取BODY元素宽度(或您认为合适的任何其他容器元素),并在脚本加载和窗口大小调整时使用该值更新.menu max-width 。 这是完整的JS: var m ... table { table-layout: fixed; } 固定桌子为我解决了它。 编辑 :似乎我太晚了! table { table-layout: fixed; } Making the table fixed solved it for me. Edit: seems I'm a few seconds too late!用于 box-sizing textarea { width: 100%; margin:0; padding:0; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; } 演示 Used to box-sizing textarea { width: 100 ...请检查以下内容。 如果你想拖动元素并将它们“丢弃”在你的战斗位置 ,你可能想要使用helper: "clone"与appendTo: "body"或任何其他选择器一起使用,你的项目将被丢弃。 我还添加了containment: 'window'和scroll: false (不太确定最后一个是否是你想要的)。 function make_draggable(elem){ $(elem).draggable({ revert: "invalid", cursor: "m ...您使用width: 92%和left: 50px 。 在大约600px的窗口宽度时,内容将是600*0.92 = 552px宽度。 向其添加50px的左侧位置,总宽度为602px 。 窗口宽度哪个更宽。 所以不要使用left: 50px ,使用left: 4% DEMO You use width: 92% and left: 50px. At about a window width of 600px, the content will be 600*0.92 = 552px width. Add the ...我已经更新了你的CSS。 更新了左侧面板,右侧面板, 内容的宽度不用calc()计算 并为您的内容留下余量。 然后将滚动条添加到内容 .content{ position: relative; width: calc(100% - 388px); border: 1px solid red; overflow: auto; display: inline-block; margin-left: 193px; margin-top: -8px; ...水平滚动打破overflow-x:隐藏在safari和firefox中(horizontal scroll breaks with overflow-x:hidden in safari and firefox)[2022-12-26]
当我想更改默认滚动条时,我通常会创建一个容器div然后设置我想要的溢出而不是在主体上。 尝试将溢出切换到宽度和高度为100%的容器div,并删除body标签上的宽度和溢出。 http://jsfiddle.net/7kd8V/21/ html { overflow:hidden; } #container { width:100%; overflow:auto; white-space: nowrap; } img { display:inline-block; }相关文章
更多- sunspot solr
- 配置sunspot tomcat结合sunspot_rails
- sunspot mongo search 步骤和注意事项
- Rails 风格指导
- Rails常用插件
- sunspot 查询语法
- Rails设置环境变量
- solr
- 全文检索(SOLR)前端应用浅析续 Rails前端分析
- 转载--solr的searching过程(1)
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。