search for: field_names

Displaying 20 results from an estimated 94 matches for "field_names".

Did you mean: field_name
2006 Jun 26
2
DRY up selects in view
...<% end %> </td> </tr> </end> Right now this works great if I only have "state_id" as the related field_name. I could repeat this for every field_name ending in "_id", but that''s not DRY. I''d like to allow this to work for any field_names ending in "_id" but I need to use the field_name without the "_id" and capitalized as the class name. I know I''m thinking about this from a scripting POV, but can I get this done? Is there a better way to do this? Thanks, Bill -- Posted via http://www.ruby-forum...
2006 Feb 02
5
access controller var within model
I need to access params[:field_name] from within my Model. @params[:field_name] isn''t working?
2010 Jul 26
1
form date helper with text year
I have a date where the year range is more then I want to define in a select_date scaffold generated year range. My idea was to have the year entered as a text field and the month and day using something like: <%= select_month @person.born,:prefix => :person ,:field_name => "born(2i)" %> <%= select_day @person.born,:prefix => :person , :field_name =>
2006 Feb 28
2
Most Popular Searches
Hi, I have an index where each document contains an untokenized ''url'' field. I would like to query the index for the most popular urls. In SQL I would do this via a Group By clause. Is there anything in Ferret that will do something similar? I found this discussion that proposed a solution involving TermEnums:
2015 Jun 20
1
Xapian with Json
Hi ! I?m newbie with Xapian ! I?m looking for the best way to index json data to be able to search by name/value pair and Full Text Search using only Xapian. I did haven?t success to found a complete or a good documentation about json index and search. Do you know some documentation about ? Another problem that I have is that: In the same name/value pair sometimes I have different data types
2006 Oct 05
4
search results autocompletion
...ew suggestion.term = term SUGGESTION_INDEX << suggestion.to_doc } } SUGGESTION_INDEX.optimize end def self.all_terms(klass) reader = Index::IndexReader.new(Object.const_get(klass.name.upcase + "_INDEX_DIR")) terms = [] begin reader.field_names.each {|field_name| term_enum = reader.terms(field_name) begin term = term_enum.term() if !term.nil? if klass::SUGGESTIONABLE_FIELDS.include?(field_name) terms << term end end end while term_enum.next? } ensu...
2006 Nov 02
5
Adding fields to a form
Is there a decent way to add a field to a form before posting it? I haven''t tried using HPricot manipulations just yet, since I can''t ever find really solid docs on hpricot.... Form#[]= doesn''t work because it first searches only pre-existing fields. I''m investigating how to write a patch now. But I thought maybe someone here might have an idea.
2006 May 03
2
Using a helper within another helper?
I am trying to push some view logic into a helper. The thought is that this is a step towards having the business logic in the helper rather than the view. However, I''m essentially wrapping the checks around an eventual call to date_select(). The problem I''m having is that the application complains that it doesn''t know about date_select(). I''m sure (or
2006 Mar 21
5
Getting a time select input
I''m having trouble workign out which ActionView DateHelpers to display a time input for an ActiveRecord field of type :time. I just want an hours input and a minuites input. I can get these with time_select helper using :field_name and :prefix but it gives both hours and miniutes the same name. <%= select_time(Time.now, :prefix => "search", :field_name =>
2006 Jun 17
0
Dynamic forms containing collections
Hiall, I have the following problem: I need to use forms containing collections (i will call them FCC), and I want to construct them dynamically, as I need to deal with quite large forms (more than 600 input fields). The variables @model_name and @field_name contain the proper model and field names as strings, which is enough for "normal" form input fields. (i.e. the "if
2006 Apr 27
3
collection_select to display 2 fields
I''m trying to get a collection_select generated Drop-down box to display two fields from a table (first name & last name); however, I am having trouble concatenating the symbols. It appears as though any code I put in the 5th argument for collection_select is processed prior to executing the collection_select method. The code executes successfully with 1 symbol in the 5th
2007 May 09
6
more_like_this
...more_like_this method indicates it supports an :append_to_query option that allows you to specify a proc that will modify the query object before the query is ''run''. This would seem to allow me to specify extra conditions to the query (such as +status:live). Item.more_like_this(:field_names => [:title, :description, :status], :append_to_query => Proc .... ) It''s a little unclear exactly what the query object is and there seem to be no examples I can find outlining how to use this functionality, does anybody have an example they could contribute ? Thanks -- Posted vi...
2006 Feb 20
0
Override automatic accessor for reference field in model
When a column in a database table is actual data, rather than an fkey to another table, I can override the automatic accessor by just doing the following: def field_name # do something here read_attribute(field_name) end This does not seem to work for me if the field is an fkey, say user_id, linking to another table. I''ve made this work by aliasing the accessor like this: alias
2005 Dec 22
2
Accessing an instance variable by its name (as a string)
Hi (again!) I have a function which gets passed the name of an instance variable, and spits its out all nicely formatted. Just wondering, how do i access the variable, when all i have is its name stored as a string? So far i''ve got this code, but it looks horrible. Is there a better way? eval("@" << inst_var_name << "." << field_name <<
2007 Jul 17
2
#more_like_this : strange behaviour
...have nothing to do with the active article. I debugged a bit and found out that the query build by #more_like_this is nothing more then "-id:<id of the active record>". (so the _result_ is correct) To try that out on the console, I used: entry = Entry.find(1) entry.more_like_this(:field_names => [''text'']) Either I''m doing something entirely wrong or there is a bug. ;) Before filing a ticket, I want to rule out the first case. Ferret version is 0.11.4, aaf version is the current stable version (although trunk didn''t work as well). I uploaded the...
2008 Nov 22
6
select_month post and params
Hi why is that not working? Controller----------------------------------------------------- def bla month = params[:month_select] redirect_to :action => "index" flash[:error_messages_for] = month.to_s end View---------------------------------------------------------- <%form_tag :action => "bla" do %> <%= select_month(Date.today,
2015 Mar 08
2
Xapian with Couchdb
Hi, I?m looking for how to integrate couchdb with xapian. Couchdb has a elasticsearch plugin, but i didn?t find anything about xapian. How is the best way to do it ? There some tips / tricks about xapian and couchdb ? Best Regards ! Carlos Brazil.
2013 Jun 16
3
Backend for Lucene format indexes-How to get doclength
Hi, all: I have wrote a demo patch for Backend for Lucene format indexes, Lucene version is 3.6.2. http://lucene.apache.org/core/3_6_2/fileformats.html Now, this demo patch just support the basic features in Lucene. Compound File(.cfs/.cfe)?term vector(.tvx/.tvd/.tvf) delete document(.del) are not supported, skip list in .fdx is not supported too example/quest.cc is used to test this demo.
2015 Mar 05
0
[PATCH v3] fish: add journal-view command
Lets user view journald log from VM in a similar format as journalctl uses. Makes virt-log use the same code as guestfish for journal-view. Fixes RFE: journal reader in guestfish (RHBZ#988100) --- cat/Makefile.am | 1 + cat/log.c | 113 +------------------------------- fish/Makefile.am | 1 + fish/fish.h | 3 + fish/journal.c | 178
2009 Apr 02
4
Uploads with FCKEditor
Hello everyone. Since I''ve found very poor documentation about the rails FCKEditor plug-in and Easy-FCKEditor (which is a fork of the very same plug-in), I decided to bother you with my noobish questions. I have this weird sensation that the image-uploading feature of FCKEditor isn''t supposed to work magically, without some sort of server side preparation, but I have no idea