Displaying 20 results from an estimated 94 matches for "field_nam".
Did you mean:
field_name
2006 Jun 26
2
DRY up selects in view
Here''s what I''ve got:
<% @fields.each do |field_name| %>
<tr>
<td>
<%= field_name.humanize %>
</td>
<td>
<% unless field_name =~ /_id$/ %>
<%= form.text_field field_name, :size => 40 %>
<% else %>
<%= select(:vendor,
field_name,
S...
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 =>
"born(3i)" %>
<%= f.text_field ?????? or text_field_tag ???????? field_name =>
"born(1i)" %>
I just can''t seem to find the set of options to buil...
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
...cumentation about ?
Another problem that I have is that: In the same name/value pair sometimes I have different data types (date, text, number), so I don?t know how to search in it.
Maybe that's a ridiculous question, but I?m a newbie.
For example:
{
?id?: 10,
?dinamic_fields?:
[
{
?field_name?:?Name"
?field_value?:?Carlos Antonio"
},
{
?field_name?:?Birthday"
?field_value?:?1975-04-23T18:25:43.511Z"
},
{
?field_name?:?Age"
?field_value?:40
},
]
}
Sometimes I need to search in ?field_value" by text, sometimes by date interval, so...
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?
}
en...
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?
...ned_start_date @plan, ''plan'', ''planned_to_start_on'',
''Planned Start Date'' %>
and from my helper:
require ''date''
module HtmlHelper
helper :date_helper
include DateHelper
def format_planned_start_date(obj, obj_name, field_name, label)
text = "<tr><td valign=\"top\"><label
for=\"#{obj_name}_#{field_name}\">"
text += "</label></td>\n"
if obj[field_name].nil? or DateTime.now < obj[field_name]
text += "<td>"
tex...
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 =>
"start_time") %>
<select name="search[start_time]">
<!-- hour options -->
<select name="search[start_time]...
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 @history_size == 1" path of the code below works
fine!) However, when using FCCs there needs to be a loop over the
instance variable which "contains all the f...
2006 Apr 27
3
collection_select to display 2 fields
...5th argument for collection_select is processed prior to
executing the collection_select method. The code executes successfully
with 1 symbol in the 5th argument, but not when trying to concatenate 2.
Any help is appreciated!
My code is below:
this works:
<%=collection_select(:model_name, :field_name, @queryname, :id,
:field_name_1)%>
this doesn''t work:
<%=collection_select(:model_name, :field_name, @queryname, :id,
:field_name_1 & :field_name_2 )%>
--
Posted via http://www.ruby-forum.com/.
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...
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 old_field_name field_name
def field_name
#do something
old_field_n...
2005 Dec 22
2
Accessing an instance variable by its name (as a string)
...iable,
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 << ".to_s")
--
Posted via http://www.ruby-forum.com/.
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 th...
2008 Nov 22
6
select_month post and params
...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, :field_name => ''month_select'') %>
<%= submit_tag "Jump" %>
<% end %>
--------------------------------------------------------------
The notice is empty after the post.
Greetings, Andi
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------...
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
....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. query like this:
field_name:term, or file_name:term1 AND field_name:term2
Until now, I found some data needed for BM25 in Xapian are not existed in
Lucene:
1. doclength_lower_bound?doclength_upper_bound
2. wdf_lower_bound?wdf_uppper_bound
3. total_length
4. doclength(for each document)
1-3 are statistics data, can be cacul...
2015 Mar 05
0
[PATCH v3] fish: add journal-view command
...:%S",
+ localtime_r (&t, &tm)) <= 0) {
+ fprintf (stderr, _("could not format journal entry timestamp\n"));
+ errors++;
+ continue;
+ }
+ fputs (buf, stdout);
+ }
+ }
+
+ const char *field_name, *field_val;
+ size_t field_len;
+ if ((field_name = lookup_field (fields[f_id]))) {
+ field_val = get_journal_field (xattrs, field_name, &field_len);
+ if (STREQ (field_name, "PRIORITY")) {
+ if (field_val && *field_val >= '0' &...
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