Displaying 15 results from an estimated 15 matches for "clients_controller".
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 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....
2006 Feb 23
3
rake error
....rb (first_time, not_needed)
** Invoke app/models/login.rb (first_time, not_needed)
** Invoke app/models/placement.rb (first_time, not_needed)
** Invoke app/models/right.rb (first_time, not_needed)
** Invoke app/controllers/placements_controller.rb (first_time,
not_needed)
** Invoke app/controllers/clients_controller.rb (first_time, not_needed)
** Invoke app/controllers/clients_controller-bak.rb (first_time,
not_needed)
** Invoke app/controllers/placements_controller-bak.rb (first_time,
not_needed)
** Invoke app/controllers/referral_notes_controller.rb (first_time,
not_needed)
** Invoke app/controllers/case_man...
2006 Jan 28
1
finishing a lookup value
I have a form...2 tables and using auto_complete
table clients
id
case_manager_id
foreign key case_manager_id to case_manager(id)
table case_manager
id
name
my app/views/clients/_form.rhtml includes which works (finally!)
<%= text_area_auto_complete_for :case_manager :name %>
and now in clients_controller.rb
def create
@client = Client.new(params[:client])
I need to add a line to this which gets the case_manager.id from the
case_manager.name that I have already derived from auto_complete and
insert it into client.case_manager_id
I can''t figure this one out. Help?
Thanks
Craig
2006 Feb 02
12
basic ''find'' question
...%>
<%= end_form_tag %>
Which I presume calls list2.rhtml which has...
<%
odd_or_even = 0
for client in @clients
odd_or_even = 1 - odd_or_even
%>
then a table/row/cell definitions and then list the clients
<td><%=h (client.wholename) %>
<% end %>
and within my clients_controller.rb I have
def list2
@clients = Client.find(:first,
:conditions => "first_name = ''Elliot''")
@client_pages, @clients = paginate :clients, :per_page => 10
end
but it lists ALL clients and not just ''Elliot''
but more to the point.....
2006 Apr 24
4
creating a select box
...eds, 2 being ''id''
and ''name''
these are the fields I need to bring over to the clients _form.rhtml.
whats the best way of going about that??
2 ways i have seen suggested that I cant get to work
-@organisations = Organisation.find_all placed this in def new in
clients_controller.rb
but jsut get an error message when trying to extract the data, not sure
if it would work if there''s no organisations entered either!
-<%
@organisations = Organisation.find(:all, :order => "name")
collection_select(:Organisation, :name, @organisations, :id, :n...
2006 Apr 26
6
get foreign key table data
Hi
I?m trying to bring across all related data.
My table clients has a foreign key field that stores the id of an
organization
How can I grab the details of the organization to use in the clients
show.rhtml file?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2007 Sep 13
2
Failing to raise an exception in a stub
...The save! call in the controller doesn''t seem to work. I get the
following error:
ArgumentError in ''ClientsController POST /clients with invalid
parameters should show new form again''
wrong number of arguments (0 for 1)
/Users/jarkko/Sites/koulutusweb/app/controllers/clients_controller.rb:
41:in `create''
The line #41 consists only of
@client.save!
I''m at a loss seeing where the wrong number of arguments is really
happening because save! certainly shouldn''t assume any args.
Moreover, both cases work fine in the real app, so it seems to m...
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 Aug 02
3
find_by_column_name and for loop returns undef method `each''
I''m trying to understand how to select only certain rows in my database
using RoR.
As a test I try to find certain clients by adding this code in my list
view...
<% clientlist = Client.find_by_client_status_id(1) %>
<% if clientlist %> <= This prevents me from getting nil errors.
<% for client in clientlist %> <= This seems to try and call
2008 Mar 26
2
Missing Method defined in controllers/application.rb
...lient = @entity.build_client(params[:client].datebalk!)
I get this exception:
undefined method `datebalk!'' for #<HashWithIndifferentAccess:0xb6c9276c>
RAILS_ROOT: /home/byrnejb/Software/Development/Projects/proforma
Application Trace | Framework Trace | Full Trace
app/controllers/clients_controller.rb:49:in `create''
I evidently misunderstand something fundamental about the role of
application.rb with respect to methods. Where should method datebalk!
be defined or what have I done wrong?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----...
2006 Jun 04
4
"can''t convert Magick::GravityType into Integer"
.../activerecord/lib/active_record/base.rb:1509:in
`each''
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:1509:in
`attributes=''
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:1438:in
`update_attributes''
[RAILS_ROOT]/app/controllers/clients_controller.rb:22:in
`edit_headshot''
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:910:in
`send''
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:910:in
`perform_action_without_filters''
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_co...
2008 Mar 08
9
Validation error handling on related models
...ity and client. Entity has_one client and client
belongs_to entity.
Entity has attributes name and legal_name. Entity also has an unique
index on (lower(name)). The pKey for both is the conventional Rails id.
Client has a fKey constraint on entity_id and is indexed in entity_id.
In controllers/clients_controller.rb I have:
# GET /clients/new
# GET /clients/new.xml
def new
@client = Client.new
@entity = Entity.new
respond_to do |format|
# new.html.erb
format.html { render :template => ''clients/edit.html.erb'' }
format.xml { render :xml => @client...
2009 Mar 05
7
issue with the object cache
Hi,
I am getting a method_missing error when I run my application in the
production environment unless I set config.cache_classes = false in
config/environments/production.rb. This happens in Rails 2.2.2 but not
in Rails 2.1.0. The method that is missing is one I used to have
before I edited by hand the migration that creates the table
associated with the object (I know you are discouraged to do
2009 Dec 06
9
Route error to Admin namespace
...me apps that i have "admin" areas to the clients manager the app.
This "admin" is a directory on my controllers path, like this:
my_site
--> app
-->-->controllers
-->-->-->admin
And my controllers in "admin", i use the correct namespace(example for
clients_controller):
class Admin::ClientsController < AdminController
Only doing it and dont use routes, it run OK if i access by the url:
http://localhost:3000/admin/clients
But local and on my server(passenger) it is ok, and function normal, but on
JRUBY i get an error because it is thinking that "admin...