Displaying 20 results from an estimated 9000 matches similar to: "select list error - following Agile guide"
2006 Mar 20
16
logic inside a view file
I am quite certain I have heard it said not to put business logic inside
view code but I have a report that I want to display 3 different
possibilities of text based upon the value of a column. Would I just
take the same type of if/then logic that I would use in a controller and
put it inside erb <%= %> stuff?
Craig
2006 Mar 07
17
Handling Erros from AWDWR
I''m getting to the point now where I really need to start trapping the
errors.
So from my AWDWR book, I added the following directly from the book into
application.rb...
def rescue_action_in_public(exception)
case exception
when ActiveRecord::RecordNotFound, ActionController::UnknownAction
render(:file => "#{RAILS_ROOT}/public/404.html",
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 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 Feb 09
17
complicated finds are eating my sole
I abandoned ruby way for find_by_sql and still can''t get this...
@myplacement = Placement.find_by_sql(
"select * from placement where
:intake_date >= beg_intake_date
and
:intake_date <= end_intake_date")
just a simple date range...it''s killing me - If I knew how to load
placement controller into irb, I could probably try out finds
interactive mode...
Thanks
2006 Feb 08
2
compound conditions in find
can''t seem to find the right syntax for this...
/script/../config/../app/controllers/placements_controller.rb:155:
syntax error
:conditions => [["placements.client_id = ?",
params[:client_id] ] and "placements.discharge_date IS NOT NULL" ],
this part works...
:conditions => ["placements.client_id = ?", params[:client_id] ]
this is what I
2006 Mar 10
6
boolean select problem
I want to use select form elements to choose between boolean options. How
can I have it default to true and still display the persisted value (either
true or false) when editing an existing object? I guess booleans default to
false by default so its not obvious how to recognize when it''s a real
''false'' that the user set or default false because the value was null.
2006 Feb 14
8
routing failures
probably something really simple but I don''t understand.
Shifting to Apache to w/ fastcgi (definitely feels faster than webrick)
Anyway, I set the default route in routes.rb to be
map.connect '''', :controller => "placements", :action => ''list''
which worked once I figured out apache...
Anyway, now that I have done that, all attempts
2006 May 17
5
text_field_with_auto_complete (newbie question)
I have the text_field_with_auto_complete woking on my user DB using
last_name. so looking for ''ivanoff'' works great, but I can''t find
''john''. Plus I like to have ''last_name, first_name'' show up in the
dropdown.
what I can''t figure out is how to concat first_name and last_name to
make a name and use that to look it.
working
2006 Feb 02
12
basic ''find'' question
I am struggling to understand the methodology here...
I have a find.rhtml
<%= start_form_tag :action => ''list2'', :first_name = client %>
<%# render :partial => ''form'' %>
<p><label for="client_first_name">First name</label><br/>
<%= text_field ''client'', ''first_name''
2006 Feb 10
14
dynarch calendar and calendar helper usage
I am playing around with this and reference this wiki from RonR site...
http://wiki.rubyonrails.org/rails/pages/CalendarHelper
The error I am getting is:
NameError in Placements#list
undefined local variable or method `date_format'' for
#<PlacementsController:0xb78f9ef4>
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
2006 Jan 25
7
join fields for list views
I am sitting with the Agile book on my desk and scratching my head at
the discussion on aggregation - perhaps that isn''t what I need.
I have a db called clients.
fields include - first_name middle_initial last_name
I want to combine them all into one name element in a list view. I can
add/edit the fields separately but in the list view, I only want the one
combo field.
Is there a
2006 Mar 22
3
strange issue locating a file
I have been editing a branch on my Fedora system, completed the changes
and was satisfied that it works and using svn, merged it to my main
trunk. I have been testing the main trunk and it seems fine. I committed
my changes to the svn repository.
On my live web application, I did an ''svn update'' which brought all the
files in but when I launch, I get an error on my
2006 Feb 07
11
breaking down a list view
I''m trying to figure out how to change the order of a list view and it''s
obvious to me that I don''t understand what I get from a simple scaffold
to know enough to alter it.
If someone would be so kind to tell me what this means ...
def list
@placment_pages, @placements = paginate :placements, :per_page => 10
end
@placement_pages, # I am guessing that this
2006 Sep 09
3
Per field analyzer
Is there a way to add per-field analyzer? I can''t seem to find a way to do that.
Thanks
--
Kent
---
http://www.datanoise.com
2006 Apr 18
3
ez_where query question
I''m having fun composing queries with ez_where, but am stuck on how to
formulate the following using the ez syntax:
(begin_date >= ? OR end_date >= ?) AND (description LIKE ? OR name LIKE ?)
There are two clauses, each containing OR operators (the ez ''any'' syntax)
but both clauses must evaulate to true for a match.
Can anyone suggest the proper way to construct
2006 Sep 06
9
Which analyzer to use
Lucene''s standard analyzer splits words separater with underscores.
Ferret doesn''t do this. For example, if I create an index with only
document ''test_case'' and search for ''case'' it doesn''t find anything.
Lucene on the other hand finds it. The same story goes for words
separated by colons.
Which analyzer should I use to emulate
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 Apr 11
9
Rails failure after upgrade to 1.1.2
Greetings,
I tried upgrading Rails to 1.1.2 and now nothing is really working. In
connection to the Rails upgrade I upgraded my Ruby version to 1.9.0. I
also upgraded all my gem installs.
Since my old rails apps stopped working I tried generating a fresh one
, alas with the same result. Below I included the full trace when
trying to reach the app. Line 3 in application.rb is :
class
2006 Jul 12
11
ruby-debug 0.1.3
Hello Everyone,
I''m pleasant to announce the release of ruby-debug 0.1.3.
If you think that ruby-breakpoint is too limited for your needs and
debug.rb brings your application to its knees, you might find
this small extension useful.
INSTALL
It''s a usual procedure:
$ gem install ruby-debug
DOCS
This library has almost identical interface with the standard debug.rblibrary.