search for: projects_control

Displaying 13 results from an estimated 13 matches for "projects_control".

2007 Dec 04
7
REST bug with form_for
Hi all, I am running on Windows XP sp2 with ruby 1.8.6, and rails 1.2.3 I am using REST, and have this in my view <% form_for(:project, :url => project_path(:user_id => @project.my_user, :id => @project), :html => {:method => :put}) do |f| %> The browser correctly gives <form method="post" action="/users/2/projects/1">
2006 Jul 06
6
Functional tsts
Hi all, I have created projects module in my application using scaffold, and it created me everything, and all the modules are working except the functional test. This is the error 1) Failure: test_create(ProjectsControllerTest) [test/functional/projects_controller_test.rb :55]: Expected response to be a <:redirect>, but was <200> 8 tests, 25 assertions, 1 failures, 0 errors 50 def test_create 51 num_projects = Project.count 52 53 post :create, :project => {} 54 55 assert_response :redirect 56 assert_redirected_to...
2006 May 10
2
gain value from form
...class="required">* </span>Reason</label><br/> <%= text_area ''offer'', ''reason_rejected'' %></p> <%= submit_tag ''Update'' %> <%= end_form_tag %> How can I gain the value of the text field in projects_controller.rb and then save it to another table by doing somthing like @project = Project.find(params[:id]) @offer = Offer.find(@project.offer_id) @offer.date_rejected = Time.now #########get value here########### @offer.reason_rejected = @offer.save -- Posted via http://ww...
2008 Apr 21
1
Urgent ActiveRecord has_many Problem - Please Help
...1) employees has_many :memberships has_many :projects, :through => :membership 2) projects has_many :memberships has_many :employees, :through => :membership 3) membership belongs_to :employees belongs_to :projects Membership is used to join employees to projects. In my projects_controller I have a method called def disassociate_employee(employee_id) end In this function I want to somehow delete the database row in membership that joins employees t o projects. I have no idea how to do this and has so far spend two full days trying to figure this out, but starting to go a bit cr...
2008 May 13
0
Problem geting web interface to work
...ction_controller/benchmarking.rb:50:in `render'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in `measure'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in `render'' #{RAILS_ROOT}/app/controllers/projects_controller.rb:9:in `index'' #{RAILS_ROOT}/app/controllers/projects_controller.rb:9:in `call'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `custom'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:133:in...
2010 Jan 07
2
Find by looping thru array
...earch based on string data some of which is very long. So I''m doing a similar match using "amatch" gem. When I have a 50% or greater match I store the id to an array. How can I do a find looping thru the array then send the query results to a partial. I have the following... - projects_controller - def search # get list of search parameters from id sent. list = params[:id] # split by comma list = list.split('','') # assign each id_search_string = list[0] title_search_string = list[1] # create new instance of Levenshtein using ''am...
2006 Apr 28
2
outputing table data
Hi, Just come across thi sproblem, and jsut cant find out what is wrong with it, if any one has any suggestions it would be good. in my projects_controller.rb I have def list @project_pages, @projects = paginate :projects, :per_page => 10 end and ths list.rhtml file I have <table> <tr> <th>Name</th> <th>Actions</th> </tr> <% if @projects %> <% for project...
2007 Aug 10
1
ActionMailer and Dreamhost
...1.3.3/lib/action_mailer/ base.rb:451:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/ base.rb:451:in `deliver!'' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/ base.rb:333:in `method_missing'' #{RAILS_ROOT}/app/controllers/projects_controller.rb:66:in `create'' -e:4:in `load'' -e:4 Thanks! -Dina --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/J...
2006 Dec 27
0
HABTM Checkboxes - Adding/Updating Users to a Project
...1 3 1 So as you can see project_id 1 contains 3 unique users to the project and they are user_id 1, 2, 3. Which I think is how i want the model to work. I think!? So when I go to my projects controller I have the standard scaffold generated code for update. #projects_controller.rb def update @project = Project.find(params[:id]) if @project.update_attributes(params[:project]) flash[:notice] = ''Project was successfully updated.'' redirect_to :action => ''show'', :id => @project else render :action =&g...
2005 Feb 09
1
cant map foreign key in list view
...for the project_manager object? The Project DB table has a foreign key column called manager_id and the Users table has a id column. Based on this Rails should be able to put project.manager_id = users.id in the SQL where clause (I hope) Rails should now allow me to do something like:- Projects_controller.rb def list @projects = Project.find_all end list.rhtml <% @projects.each do |project| %> <tr> <td><%= project.project_manager.firstname %></td> </tr> <% end %> But I get an error:- Showing /projects/list.rhtml where line #3...
2007 Oct 17
2
Complex Forms (From Railscasts.com)
Hi, I have been watching the last three episodes on railscasts.com in which he goes through dealing with multiple models in one for using fields_for, and virtual attributes. (http://railscasts.com/episodes/ 73). Here is an example of the way they suggest to go about it: # projects_controller.rb def new @project = Project.new 3.times { @project.tasks.build } end def create @project = Project.new(params[:project]) if @project.save flash[:notice] = "Successfully created project." redirect_to projects_path else render :action => ''new''...
2009 Jul 29
0
Problem uploading file to database mysql blob field
...ce app/models/attachment.rb:56:in `file='' app/models/attachment.rb:60:in `file='' app/controllers/application.rb:183:in `attach_files'' app/controllers/application.rb:180:in `each_value'' app/controllers/application.rb:180:in `attach_files'' app/controllers/projects_controller.rb:195:in `add_file'' vendor/rails/activerecord/lib/active_record/base.rb:2372:in `send'' vendor/rails/activerecord/lib/active_record/base.rb:2372:in `attributes='' vendor/rails/activerecord/lib/active_record/base.rb:2371:in `each'' vendor/rails/activerecord/lib/...
2006 Dec 24
8
HABTM Reading Rows From Two Tables
...null => false end -------------------------- MODELS -------------------------- class Project < ActiveRecord::Base has_and_belongs_to_many :users end class User < ActiveRecord::Base has_and_belongs_to_many :projects end -------------------------- CONTROLLER -------------------------- # Projects_Controller # I have the generic scaffold running my list view def list @project_pages, @projects = paginate :projects, :per_page => 10 end # list.rhtml # I just want to be able to pull the projects and users that belong to the project into a view. # Some projects may have 3 or 4 users. # so...