similar to: Integrating polymorphic models into controllers views? how?

Displaying 20 results from an estimated 200 matches similar to: "Integrating polymorphic models into controllers views? how?"

2017 Nov 18
2
family
Hi all, I am reading a huge data set(12M rows) that contains family information, Offspring, Parent1 and Parent2 Parent1 and parent2 should be in the first column as an offspring before their offspring information. Their parent information (parent1 and parent2) should be set to zero, if unknown. Also the first column should be unique. Here is my sample data set and desired output. fam
2011 Feb 18
3
recoding a data in different way: please help
Dear R users The following question looks simple but I have spend alot of time to solve it. I would highly appeciate your help. I have following dataset from family dataset : Here we have individuals and their two parents and their marker scores (marker1, marker2,....and so on). 0 means that their parent information not available. Individual Parent1 Parent2 mark1 mark2 1 0 0
2006 Mar 22
10
Need for multiple acts_as_list
I have a model "Childmodel" that belongs_to two other models "Parent1" and "Parent2". "Parent1" "has_many :childmodels, :order => :positionp1" and "Parent2" "has_many :childmodels, :order => :positionp2". i.e. The child is independently positioned within each of its parents. This works fine and gets me the useful
2007 May 31
16
Could anyone please help with rspec/nested resource behavior checking?
My problem has been listed here: http://railsforum.com/viewtopic.php?pid=25439#p25439 Don''t think it would be required to completely re-type it here :) Thanks! -- -Daniel Fischer http://danielfischer.com - Geek Blog http://abigfisch.com - Portfolio http://writersbeat.com - Writing Community
2007 Aug 08
5
Can''t seem to spec a ActiveRecord::RecordInvalid exception properly...
1 def create 2 @user = User.new(params[:user]) 3 @user.save! 4 self.current_user = @user 5 redirect_to user_path(@user) 6 flash[:notice] = "Thanks for signing up!" 7 rescue ActiveRecord::RecordInvalid 8 render :action => ''new'' 9 end I can''t seem to properly spec this out. I am trying numerous things, the latest one is
2010 Apr 23
2
link_to with resource routes in helper file?
Hey all! Any pointers on doing something like: link_to "Comments", comments_path from within a helper file just like you can do from a view? Thanks in advance! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To
2007 May 24
3
Annoying problem, stack error
For some reason rake spec is totally crapping out on me. I don''t know what I did to make it break, the only thing I tried new was install haml, but even after removing it there is still a stack trace. Here is what I am getting- sparta at phalanx ff $ rake spec (in /Users/sparta/Projects/work/idastudios/ff)
2007 May 25
1
RCov?
Sorry to be a newb about this, but I''m trying to integrate rcov into my tests. I tried to follow the example located here: http://rspec.rubyforge.org/tools/rcov.html But to my dismay, I just don''t understand what to do. I tried to run that task in the rspec plugins directory, but it threw an error about pre_commit. Regardless though, I want to be able to rcov all of
2009 Apr 05
1
[cucumber] Nested resource in paths.rb
Hello Rspec Users, I was wondering how you specify a nested resource in cucumber. So for example: Given I have a blogpost titled Question For Nice Rspec Users When I am on the list of comments for Question For Nice Rspec Users Then I should see "Answer" Now, as one might expect, blogpost has_many :comments, so my question is this: How should I write the "when-case" for
2007 Sep 08
11
changes to TextMate bundle
Hi all, I got some help from James Edward Gray II on the RSpec TextMate bundle. For those of you who don''t know James, he runs the Ruby Quiz and also maintains the official TM bundle. Per a couple of patches from him and some advice that I acted on, many of the shortcuts have changed. The bad news is you''ll have to learn new shortcuts. The good news is that the new shortcuts
2007 Dec 03
18
Need help mocking this out
Let''s say you''re using the restful_authentication plugin. You have a model called articles. On the index action of the articlescontroller you simply want to spec out that it''ll scope the results to the ownership of the current_user. It should NOT include any articles other than the articles that user owns. How would you properly spec this out? Thanks for the help!
2007 Jun 02
7
I''m really bad at controllers, help please.
Hey, Sorry for so many questions - I''m really bad at this right now. I''m trying to cover the following code w/ rspec def index if params[:user_id] @user = User.find(params[:user_id]) @messages = @user.messages end end So basically what I''m doing is listing all the messages for a user, provided there is an id parameter. describe
2009 Apr 23
1
Excluded directories at rsync (was "--filter, missing in action")
On Thu, 23 Apr 2009 17:32:37 +0200 Paul Slootman <paul+rsync@wurtel.net> wrote: > --delete-excluded will screw this up. Yes, this is why I don't use it. This is probably a bug because the excluded directories with "- DIR/**" will became empty on all receivers (SLAVE hosts). But with just "--delete" the excluded directories are not synchronized with the MASTER
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem: Mock ''Task_1005'' received unexpected message :user_id= with (1) No matter what I do to try to stub that out it will still fail out and give me that message. Here is my spec describe TasksController, "handling POST /tasks" do before(:each) do @task = mock_model(Task, :to_param => "1", :save => true)
2007 Aug 03
2
Plugins ''speced'' with rSpec?
Hello, I''m trying to figure out how to setup a spec structure for plugins. I''m getting pretty lost in figuring out how to isolate a plugin enviornment emulating rails, but not actually being reflected upon the current rails project. What I mean is this, let''s say I have a comment plugin. This has two things in lib, the comment model (comment.rb) and then the module
2008 Aug 26
6
Rails deployment issue... no such file or directory - getcwd? huh?
Everything works fine locally but when I deploy I get this: Errno::ENOENT (No such file or directory - getcwd): /vendor/rails/activerecord/lib/../../activesupport/lib/ active_support/dependencies.rb:78:in `expand_path'' /vendor/rails/activerecord/lib/../../activesupport/lib/ active_support/dependencies.rb:78:in `require_or_load''
2007 Aug 10
2
uninitialized constant MiniMagic (NameError)
Hi, Mini-Magick breaking. I have installed mini-magick gem. Here is my sample program require ''rubygems'' gem ''mini_magick'' include minimagick image = MiniMagick::Image.from_file(''./fun.jpg'') image.resize "100x100" image.write(''./funthumb.jpg'') Output: test.rb:3: undefined local variable or method
2009 Jan 07
0
Actionmailer and postfix settings
Hi, I am having problems configuring my actionmailer to work with postfix. I followed this tutorial: http://howtoforge.org/virtual-users-and-domains-postfix-courier-mysql-centos5.1 and i got the server set up. at first i fixed the mail settings to work with gmail using this tutorial: http://www.danielfischer.com/2008/01/09/how-to-use-gmail-as-your-mail-server-for-rails/ and my app worked
2007 Jun 27
5
Regexp not matched
Sorry, meant to post this in the rails forum. Anyways, how would I write a rescue method to recover from a failed regexp parsing with error "regexp not matched" -Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources