Displaying 8 results from an estimated 8 matches for "new_project".
2006 Jan 10
15
KISS and DRY? Not even close!
...Rails is about. Does this sound familiar
to anybody out there?
I''m not going to include my whole app but below is one method that made me
come to the formentioned dilema.
The models:
company (hm) <-> (bt) contacts
project (ho) <-> (bt) project_contacts
The guilty actions (new_project and create_project) are shown below:
(They''re workin, but I don''t even wanna think about the edit/update actions)
def new_project
@project = Project.new
@contacts_list = Contact.find_by_sql(''select t1.name, t2.first_name,
t2.last_name, t2.id from companies AS t1, con...
2006 Apr 30
0
populating model attribute from one of many lists
...can choose from a list of "recent"
projects (Projects associated with Bookings dated within the past N
days). I settled upon the following as a way to present the different
lists of projects:
I added three attributes to the Booking model:
attr_accessor :recent_project, :all_project, :new_project
The view for creating new Bookings is provided two lists of Projects
(@projects and @recent_projects) which are used to create
corresponding select lists, essentially:
<%= select :booking, :recent_project, @recent_projects,
:include_blank => true %>
<%= select :booking, :all_pro...
2006 Jan 02
2
Dynamic form tags
...seEditViewsForNewViews
There''s this comment there saying you only need the tag "<%= auto_form %>"
when using the code below. Can somebody tell me if that will work when
extending it with model_name (some how)?
I have several new_* methods (e.g. new_contact, new_company, new_project,
etc), and I''m not going to bother with this challenge when you big guys out
there tell me it''s a no go to develop this.
def auto_form
action = case controller.action_name
when "new" then "create"
when "edit" then "update"...
2006 Jan 09
2
catch id from form and copy between objects
Hi all,
Not completely sure what I''m doing, but I need to get data from another table
based on and id. Below is some breakpointer output:
irb> @params
=> {"project"=>{"project_description"=>"point2", "project_name"=>"break2"},
"action"=>"create_project",
2006 Jan 08
4
ID from child table not handled by AR
...rect btw. What''s
eventually needed is to copy contact info from another contact table all
together.
Some info:
## Models:
class Project < ActiveRecord::Base
has_one :project_contact
end
class ProjectContact < ActiveRecord::Base
belongs_to :project
end
## Controller Methods
def new_project
@project = Project.new
@contacts_list = Contact.find_by_sql(''select t1.name, t2.firstname,
t2.lastname, t2.id from companies AS t1, contacts AS t2 where t1.id =
t2.company_id order by t1.name'')
## Showing a nice dropdown list with "Company - Fname Lname"
## Than...
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all,
For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an
object @project_contacts with "Name" from table Companies and "Firstname" and
"Lastname" from table contacts. Any idea?
Regards,
Gerard.
--
"Who cares if it doesn''t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS
2008 Mar 14
15
Am I off track on my testing?
Is it just me or does anyone else miss being able to create something
quickly. Once you start writing all the tests your time is now
increased by a factor of 10. I agree with the logic in testing, but am
I doing something wrong?
Take the simple example of a controller test for an index action that
shows all the forum posts for a user account.
The controller code would be something like what is
2007 Aug 24
0
speex DTX chore
hi there,
I am new to mailing list so excuse me if I don't obey to the 'netiquette'.
i am writing voice chat and speex is in the root of it. i write it in Java and use JNI to link with 'C'-based Speex 1.2beta. [I know of JSpeex but there are not implemented some features]
recently i decided to use DTX feature of speex as well. the code follows. The problem is that no matter