similar to: Go back to previous action

Displaying 20 results from an estimated 1000 matches similar to: "Go back to previous action"

2010 Aug 10
3
Intersecting list vs rows in matrix
Know that if I have List_1 and List_2 that I can check to see if the intersect via the code below: List _1: a, b, c, d, e, f, g List_2: z, y, x, w, v, u, b length(intersect(List_1, List_2)) > 0 return = true If instead I wanted to check a dataframe that is a "list of lists," how would I do that by record without looping? List _1: a, b, c, d, e, f, g List_2: z, y, x, w, v,
2008 Jan 04
2
Nested Routes + Facebook Resources
Does anyone have nested routes working with the facebook_resources method? My routes.rb has: map.facebook_resources :users do |users| users.facebook_resources :images users.facebook_resources :connections end but user_connections_url won''t generate. "rake routes" gives me: new_user POST /users/new {:action=>"new",
2010 Jun 13
4
Are any values in one list contained within a second list
Silly question, but, can I test to see if any value of list a is contained in list b without doing a loop? A loop is easy enough, but wanted to see if there was a cleaner way. By way of example: List 1: a, b, c, d, e, f, g List 2: z, y, x, w, v, u, b Return true, since both lists contain b List 1: a, b, c, d, e, f, g List 2: z, y, x, w, v, u, t Return false, since the lists have no mutual
2006 Jun 16
6
Drag and Drop work in IE?
Please, I''m build an drag and drop tree using scriptaculous and it is perfect in FF but when I test in IE don''t work, I drag the element and when I free the button the element don''t go to the place, stay in the mouse pointer... What can do it happen? I''m using last version of scriptaculous. Thank you, Pedro
2006 Mar 01
1
Eager loading problem. Help greately appreciated
Each Timesheet has an employee. An employee has a division and a location. I want to find all the timesheets with a status of 2. I then iterate over the timesheet collection and print the timesheet name, employee name, employee divison name, and employee location name. Like so: for t in Timesheet.find(:all,:conditions=>"status=2",:include=>:employee) puts timesheet.date
2006 Jul 12
6
Showing rows on a page
This is my first rails program and I?m having trouble figuring out how to show rows on the page when there may not be rows in the database. There are 3 tables, employees, cost_codes and timesheet, I will simplify them when describing them later on. When an employee logs in, I would like to pull up their timesheet, which should consist of one row per cost code. So timesheet would look a
2006 Jan 19
2
select vs. select_tag
I have a "Users" object and a "Timesheets" object. Each timesheet entry belongs to a User, which is selected from a drop-down list. The timesheet has a user_id field. (The user needs to have an option to select a different user due to the way our system works.) If i use the "select" object, which is bound to the Timesheet model, using this code: <%= select
2013 Mar 30
1
How to use group in nested associations
The below query fails: Timesheet.joins(:time_entries).select("timesheets.*, sum(time_entries.worktime) as total").group("timesheets.start_date") The models have the following relations: Timesheet < AR has_many :activities, dependent: :destroy, inverse_of: :timesheet has_many :time_entries, through: :activities accepts_nested_attributes_for :activities,
2006 Aug 04
5
query across tables
I am trying to do things the proper rails way and use the auto generated id to refernce other tables. Now I''ve hit a wall in trying to write a query. timesheets: id, employee_id, code_id, ... values codes: id, job_number, code How can I show just the timesheets that belong to a specific job? I would need to check the codes table and look at the jobs, so I was thinking of something
2006 Mar 28
2
Fastest way of adding " " around multiline text in RADRAILS
lets say i have the following SQL in my database editor : When i paste it into rad rails i have to add quotes and the ''+'' symbol to the end of each line. It is very tedious. What is the best method? select timesheets.employee, sum(items.hours) as hours, sum(items.hours*timesheets.cost) as cost, sum(items.hours*timesheets.charge*decode(activities.chargetype,0,1,0)) as charge,
2006 Jul 31
1
Adding new rows to a db
I''ve created the following function, and for testing have hardcoded the following values: def addNewRow @timesheet = Timesheet.find(:employee_id => ''1'', :cost_code_id => ''14'', :dept => ''007'', :ending_date =>
2007 May 16
2
very odd controller spec problem
Here''s a snippet: it "should provide the fund" do get(:timesheet,{:id=>@fund.id}) assigns[:fund].should == @fund end Works fine on my box, fails on my CI server. Here''s the output: NoMethodError in ''The FundController timesheet should provide the fund'' You have a nil object when you didn''t expect it! You might have
2013 Mar 25
1
validates presence of foreign key fails in nested form
I''m using accepts_nested_attributes as follows: class Timesheet < ActiveRecord::Base attr_accessible :status, :user_id, :start_date, :end_date, :activities_attributes has_many :activities, dependent: :destroy has_many :time_entries, through: :activities accepts_nested_attributes_for :activities, allow_destroy: true end class Activity < ActiveRecord::Base attr_accessible
2013 Mar 04
2
accepts_nested_attributes: undefined method 'association'_attributes
I have 2 models Timesheet and TimeEntry: class Timesheet < ActiveRecord::Base attr_accessible :status, :user_id, :time_entries_attributes has_many :time_entries, dependent: :destroy accepts_nested_attributes_for :time_entries, :reject_if => proc { |attributes| attributes[''worktime''].blank? } end class TimeEntry < ActiveRecord::Base attr_accessible :task_id,
2009 Mar 10
5
onsubmit for remote_form_for not working properly
I want to use onsubmit for a form validation using javascript on remote_form_for for this i am doing something like this <% remote_form_for :timesheet, @timesheet, :url =>{:action => ''report_user''}, :html => {:onsubmit=>"return ValidateDate();" } do |f| %> // Form elements here <% end %> but it not works well. if condition return false
2006 Feb 11
4
Timesheet application for Rails
Hi all, I am looking for some time tracking software for our small company. Does anyone knows if such project on rails exists? I need simple functionality such as recording spent time for employees and managing projects or tasks. Ideally, it would be possible to integrate it into Instiki and to some existing database. There are some other solutions, but it seems to me that RoR would be ideal
2006 Mar 08
3
getting holiday dates?
Hi, i''m writing a timesheet application in which i need to know when the holidays are, (bank holidays, etc) Is there a very clever way of getting this info that wouldnt require me to manually add it to my database?? Thanks Chris -- Posted via http://www.ruby-forum.com/.
2006 Jan 05
2
help - edit without using scaffold
Hello, What am I doing wrong? The code below does not show the current record for editing. def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) flash[:notice] = ''User was successfully updated.'' redirect_to :action => ''show'', :id => @user else render :action
2006 Aug 10
4
Speeding up ActiveRecord creation?
My completely empty model (no validation callbacks etc etc) takes an average of 0.05 seconds to create, at least according to Benchmark.realtime{200.times{Message.create(:from => "me@here.com", :message_type => ''email'', :subject => "hello", :body => "goodbye", :sent_at => Time.now)}}/200 That''s a little slower than
2006 Mar 24
2
Slider: passing the slider object to onChange and onSlide?
I''m working with a couple of slider objects on one page. I''m using onChange to do a couple of things. onChange passes the new value of the slider, but not the slider object itself. Has anybody found a way to get the object? More details: A simple example would be to do the following: Put multiple sliders on a page. Now, when a slider is moved, change it''s track