Displaying 20 results from an estimated 53 matches for "default_opts".
Did you mean:
default_op
2006 May 01
12
pagination in acts_as_ferret
I''m just wondering where I would put the pagination for search results
when using "acts_as_ferret".
At the moment my search code is..
def search
@query = params[:query] || ''''
unless @query.blank?
@results = Tutorial.find_by_contents @query
end
end
Cheers
SchmakO
--
Posted via http://www.ruby-forum.com/.
2007 Oct 03
3
Pagination problem with acts_as_ferret
Hi,
am using this wonderful plugin acts_as_ferret and according to the
tutorial at http://railsenvy.com/2007/2/19/acts-as- ? rial#basic
I worked it out except the pagination feature.
If I have 12 records and I give limit to 10, its correctly displaying 10
records in the first page and is giving the link to the second page too.
But when I go to the next page I find the same 10 records instead of
2007 Sep 05
1
AAF and DRb with highlighting
How would I change this method in order to get highlighting working with
DRb? I''ve given up on searching on Google, I''m getting no results that
are actually helpful.
def self.find_storage_by_contents(query, options = {})
# Get the index that acts_as_ferret created for us
index = self.aaf_index.ferret_index
results = []
default_options = {:limit => 10,
2006 Oct 22
3
Date Helpers?
Does anyone have any ideas off the top of there head how to easily construct
a date helper as one would see in Rails?
Thanks,
Michael Gorsuch
http://www.styledbits.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/camping-list/attachments/20061022/7dda5a52/attachment.html
2007 Feb 04
10
[AAF] remote indexing via DRb with acts_as_ferret
Hi!
Aaf trunk has undergone several major refactorings the last days, with
the result that you can now transparently switch your app from local
to remote indexing and back :-)
If you plan to scale your app to more than one physical machine, or
if you have problems with corrupted indexes and the like under high
load, you really should give this a try.
I wrote some documentation to get you
2007 May 02
4
Wrong total_hits when using conditions in find_by_contents
In my model Topic:
acts_as_ferret({ :fields => {:username => {:store => :yes, :boost =>
30}, :subject => {:store => :yes, :boost => 20}, :body => {:store =>
:yes, :boost => 10}}, :remote => true }, { :analyzer =>
Ferret::Analysis::RegExpAnalyzer.new(/./, false) })
def self.full_text_search(q, options = {}, find_options = {})
return nil if q.nil? or
2009 Mar 15
5
Setting DEFAULT_FIELD_OPTIONS in Rails 2.3
Hi,
I''m having some trouble overriding/defining the default_field_options
constant without raising a warning. I''ve tried adding the code to do
it in an initializer but that produces a warning (because the constant
is already frozen), after some googling I found a recommendation to
put it in the environment.rb file but that then that throws
uninitialized constant ActionView
2007 May 24
2
Missing RspecScaffoldGenerator
Just a quick note that I had to make the following change after
installing 1.0.2 as rails plugins to get the resource generator
working:
Index: rspec_scaffold_generator.rb
===================================================================
--- rspec_scaffold_generator.rb (revision 2022)
+++ rspec_scaffold_generator.rb (working copy)
@@ -1,4 +1,4 @@
-class RspecResourceGenerator <
2006 Nov 20
22
Index only partially built
I have an application which I''m running using Mongrel and Apache as
described here http://www.napcs.com/howto/rails/deploy/.
I have a model Person which I am attempting to use acts_as_ferret with.
When I first try to do a search the index begins to get built but it its
fails halfway through with the following error in the browser:
===
Proxy Error
The proxy server received an invalid
2006 Apr 13
2
running rails on Linux
I''ve done local installs of ruby-1.8.4, then rubygems-0.8.11, then:
% gem install rails
I get rails and its dependencies all going into:
/local/pkgs/ruby-1.8.4/lib/ruby/gems/1.8
i.e.
/local/pkgs/ruby-1.8.4/lib/ruby/gems/1.8/gems/rails-1.1.2
In the rails directory I see:
/local/pkgs/ruby-1.8.4/lib/ruby/gems/1.8/gems/rails-1.1.2/bin/rails
which I presume is what is executed when
2007 Jul 18
5
Strange search result with conditions in find_by_contents
Hi, guys:
Strange search result with conditions in find_by_contents!
first of all, i''ve installed the acts_as_ferret to my project vender
folder by ''ruby script/plugin install
svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret''
in my SearchController
def searchforum
if !params[:doSearch].nil?
if params[:searchTerms].nil? || params[:searchTerms] ==
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code:
@project_pages, @projects= paginate :project,
:per_page => 10,
:conditions => ["account_id = ?", account]
?!
If only I could pass the sub-collection
account = ...
@projects = account.project
to paginate, instead of letting it extract it with a find :all + sql
conditions
Alain.
--
Posted via
2001 Mar 10
0
patch to add device-option to ogg123 rc file
Below is a patch for vorbis-tools-1.0beta4 ogg123.
It adds support for using the rc file (like /etc/ogg123.rc) for
configuring the device-options. In addition, comments can be used (when
they start a line).
My ~/.ogg123rc:
default_device=oss
default_options=dsp:/dev/audio
Please share your comments.
Jeremy C. Reed
http://www.reedmedia.net/
diff -u
2006 Jul 31
9
Multiple Pagination
I have the following:
def index
begin
@restaurant_pages, @restaurants = paginate :restaurants,
:order => (params[
:sort ] || "name"),
:per_page => 2
@cuisines = Cuisine.find_all
rescue
redirect_to :action => :index
end
end
# sort by cuisine
def
2006 Jul 27
0
Override default Rail Generator options
I''ve been hacking at this for hours now.
I found a method called ''default_options'' in Rails::Generator::Base. By
default it calls ''default_options :collision => :ask, :quiet => false''.
I''d like to over ride it with my own options. It works if I just change
it in the Rails source but thats not a real solution.
Is there any way to set
2006 Jun 10
0
Dynamic file paths in FileColumn
I have a file uploader application in ROR using the very nice FileColumn
plugin. In looking at the source code I can see that there is a
DEFAULT_OPTION hash with some root path options and such which can be
merged from an options paramater. These static path changes are not a
problem.
My question is dynamic path options. My upload form, when you boil it
down, has two fields. The first is
2006 Feb 27
0
Simple Namespace Question
I put the following code into my application_helper.rb file, which will
allow super fancy ajax pagination blah blah blah.
Now the problem is, it''s not being identified.
I''m running Rails 1.0.0, and froze edge, so it''s sitting in /vendor.
The actual pagination_helper.rb file is appropriately sitting in:
/vendor/rails/actionpack/lib/action_view/helpers
2006 Nov 08
0
Paginating a fetched resultset problems with next/previous
Im using this paginate function to paginate complex sql queries
http://www.bigbold.com/snippets/posts/show/389, all seems to work fine
but theres one thing, when i hit the next link it show nothing, i mean
it only shows the first page, here is the code im using:
#application.rb-----------------
def paginate_collection(collection, options = {})
default_options = {:per_page => 10, :page
2009 Feb 03
1
Passing args to generator
I have some default_options in generator and when I wish to change they
value with --option_name I get only logical true instead of string
...
default_options :option_name => "Some string"
...
def add_options!(opt)
opt.separator ''''
opt.separator ''Options:''
opt.on("--option_name","Some Text") { |v| options[:option_name] = v
2012 Jan 25
0
Paperclip preserve files ?
Hi,
I am using paperclip to upload files. The problem I am facing is,
based on my object property I need to preserve my file. Means my object
should be deleted from db but the file need to be restored.
I am using the option :preserve_files => true.
If I keep the above option in model it will be access to all the
objects of the model. I need to restore only for limited objects.