Displaying 20 results from an estimated 900 matches similar to: "finishing a lookup value"
2006 Jan 29
1
returned values and consequent usage
I think I can have finally reduced my problem to something somebody can
help me with.
I am using auto_complete...
specifically the form command is...
<%= text_area_auto_complete_for :case_manager :name %>
I need to use the value derived here in my controller...
If I use...
cm = CaseManager.find(:first, :conditions => "name = ''Thomas E Dewey''")
it works.
2006 Jan 30
5
Lookup from related tables
I have been working on this for 3 days and haven''t been able to solve
it.
I have 2 tables...
clients
belongs_to: case_managers
case_managers
has_many: clients
When entering new clients, I need to have some type of select box that
allows me to pick the case_manager (by name) so that the ''id'' field from
the case_manager table is inserted into clients.case_manager_id
2006 Jan 25
2
select list generated from table
Have 2 tables - clients & case_managers
class Client < ActiveRecord::Base
has_one :case_manager
end
app/views/clients/_form.html contains line...
<p><% collection_select("client", "case_manager_id", \
case_manager.find_all, "name", "id") %></p>
and this line generates error...
undefined local variable or method
2006 Feb 06
3
linked table confusion
placement.rb
has_one :client
has_one :case_manager
client.rb
belongs_to :case_manager
has_many :placements
case_manager.rb
has_many :clients
has_many :placements
I am trying to create a view file for placements.
I can pull columns from clients table in this view by using...
<%= @placement.client.wholename %>
but if I use
<% @placement.case_manager.wholename %>
2006 Jan 28
1
referencing a table
I am trying to use auto_complete_for to reference a different table.
in my clients_controller.rb file
auto_complete_for :case_manager :case_manager.name
^^^^^^^^^^^^
this is not the clients table
my models/clients.rb has:
has_one: case_manager
The above ''auto_complete_for'' line in clients_controller.rb
2006 Jan 25
17
Lookup pattern in Ruby
Hi folks,
I''m curious how a lookup with a large group of values would be handled
in Rails.
For example, I have a (contrived) AnimalType filtering a list of many
Animals--more than can be presented comfortably in a dropdown box.
Therefore I need to either redirect to another screen to select an
animal (returning after the selection is made), or show a dialog--modal
or otherwise--to
2006 Jan 26
0
selecting from dynamic pop-up list populated by a table
I''ll try again...
I am looking at this page...HowToUseFormOptionHelpers
http://wiki.rubyonrails.org/rails/pages/HowtoUseFormOptionHelpers
perhaps I should be using Ajax for this...I haven''t looked at Ajax yet.
Have 2 tables - clients & case_managers
I want the data from a column in case_managers to be the select list on
a screen for adding/editing clients as I am pretty
2006 Feb 23
3
rake error
I installed at least one gem since I thought I actually once was able to
run ''rake appdoc'' command since there is an api for my models and the
ez_where plugin that I installed earlier. I wanted to see the api for
pdf-writer which is the gem that I installed most recently.
(no, I haven''t given up the issue of ''looping'' that Kevin and some
others replied
2006 Feb 08
7
DRY methodology
because I am a grasshopper...
Now that I can sort my ''list''...is there a logical way of not repeating
myself to having essentially the same list view with multiple sorts?
i.e.
def list_cl
# ordered by clients last name
@placement_pages, @placements = paginate(
:placements,
:include => [:client],
:order_by =>
2006 Feb 03
9
Because I''m very slow - trying to use console
I can''t see how to use variables so I am using console to test things
out...
clients table - a column named first_name
My very brief console session...
>> clients = Client.find_by_sql("select * from clients where first_name
= FN")
ActiveRecord::StatementInvalid: RuntimeError: ERROR C42703 Mcolumn
"fn" does not exist Fparse_expr.c L1034
2006 Feb 21
8
Validations continued
I simply can''t figure this out. I have been reading and re-reading Agile
book and wiki.rubyonrails.org - all sorts of validation methods and
still, it doesn''t work.
Controller code
def create
@client = Client.new(params[:client])
if @client.save!
flash[:notice] = ''Client was successfully created.''
redirect_to :action =>
2006 Mar 25
1
foreign keys on migration
I have reached a development plateau and now want to integrate some of
the rails niceties that I passed over to get the system online.
I am fooling with migrations. I am using postgresql. I put in my
migration script (at the end of the ''up'' method, the following raw sql
code...
# set up primary key restratints for PostgreSQL
execute ''ALTER TABLE ONLY
2006 Apr 02
5
foreign keys and migrations
Hi:
I''m looking to get a point clarified which i''m sure is obvious to
everyone else but I haven''t been able to find the answer to. i''ve
tried searching through the forums and the api pages and haven''t found
anything.
Is there a way with migrations to set up foregin key relationships?
(beyond putting in the relevant foregin_id attributes)
Is
2008 Jun 05
23
unit test question
In development and production, I''ve got postgresql constraints that
prevent deleting a CaseManager if there is a Client that belongs to that
CaseManager.
In unit tests...and obviously in my testing db, those restrictions don''t
get added.
Is it wrong to test for deleting dependent records in unit tests?
Craig
--~--~---------~--~----~------------~-------~--~----~
You received
2006 Jan 30
3
general questions
Agile book lacks some basic information, perhaps I need to learn ruby as
I am lacking information - some basic things - especially debugging.
The following are stupid newbie questions and any portion of them
answered would be great.
1. If I am viewing a page from app/views/clients/ and on this page, I
want to put a ''link_to'' directive to say app/views/case_managers...
how do I
2006 Feb 07
0
second table column data lift
have placements, clients and case_managers tables with relationships
Trying to create new placement record...case_manager_id field exists in
clients table. I need the value from related clients record in
placements table
in placements_controller.rb
def create
@placement = Placment.new(params[:placement])
case_manager_id = Client.case_manager_id # this doesn''t work
if
2008 Dec 25
5
Plugin auto_complete
Hi all !
I began to develop Rails applications with Aptana Radrails under
Windows. For that I had successfully installed auto_complete plugin and
succeeded to use it.
Now I have an iMac and I''m trying to restart my developments under OS X.
My problem is: when I run the command ''script/plugin install
auto_complete'', the result is:
Plugin not found:
2006 Mar 17
1
Autocompleter.Local problem/desparate plea for help...
I have been trying to write a selector function for Autocompleter.Local that
will show a predefined Array and will scroll automatically to the first
match. I have had success with with getting my list to populate and show
all of the choices, however I cannot get it to scroll to the first match.
Since I build the JS Array I can know exactly how many items are in the list
going into my selector,
2006 Feb 27
2
Ajax - from there to here
Trying to use Amy Hoy''s ajaxariffic auto_complete methodology and I am
getting really close to the end.
This is fairly complicated but I will simplify as best I can.
My view code is simple...
<%= text_field_with_auto_complete ''client'', ''wholename'' %>
# wholename is not a column in ''clients'' but rather represents an
2009 Apr 19
2
Upgrading from Rails 1.3.x to 2.3.2 - text_field_with_auto_complete not working
Folks,
I am trying to upgrade code base from 1.3.x to 2.3.2 and not
surprisingly, lot of things are broken.
''text_field_with_auto_complete'' is not working for me - it gives the
following error:
ActionView::TemplateError (undefined method
`text_field_with_auto_complete'' for #<ActionView::Base:
0x7f0ceb6b8290>)
I already have installed auto_complete -
ruby