search for: create_project

Displaying 8 results from an estimated 8 matches for "create_project".

2006 Jan 09
2
catch id from form and copy between objects
...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", "id"=>{"collect"=>"6"}, "controller"=>"adm/project"} The one I want is the ''6'' in "id"=>{"collect"=>"6"} The irb output is right after the form submission. The following statem...
2008 Sep 09
8
Cucumber and fixtures/FixtureReplacement
Hey guys, I''d never used RSpec Stories before, so I decided to follow the apparent direction of the wind and just jump right into cucumber. I''m dabbling with/using Cucumber and really like it. Good job, aslak! Where i''m struggling right now is using either fixtures or a model factory methodology like the FixtureReplacement. In both cases, I''m not
2006 Jan 10
15
KISS and DRY? Not even close!
...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, contacts AS t2 where t...
2006 Jan 10
8
Noob: Child records not saved
Hi all, happily coding along, but it seems a belongs_to record is not saved. # Create some stuff def create_project @contact = Contact.new @project = Project.new(@params[''project'']) @project_contact = ProjectContact.new(@params[''collect'']) @project.project_contact = @project_contact contact = Contact.find(@params[''id''][''collect'']) # C...
2006 Jan 08
4
ID from child table not handled by AR
...by t1.name'') ## Showing a nice dropdown list with "Company - Fname Lname" ## Thanx to Chris Hall @contacts_list = @contacts_list.collect { |c| [ c.name + " - " + c.firstname + " " + c.lastname ] } render_action ''edit_project'' end def create_project @project = Project.new(@params[''project'']) @project_contact = ProjectContact.new(@params[''id'']) @project.project_contact = @project_contact #@project.project_contact.save if @project.save flash[:notice] = ''Project was successfully created.'...
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 Dec 06
43
Mocks? Really?
OK, so i''ve played a bit with mocks and mock_models in controller and view tests and i have a question. Is this statement really correct: "We highly recommend that you exploit the mock framework here rather than providing real model objects in order to keep the view specs isolated from changes to your models." (http://rspec.rubyforge.org/documentation/rails/writing/views.html