Based on the walkback, whatever object the @plat instance variable is
assigned to is causing the error when sent the id message, hopefully
your own debugging skills will enable you to use that clue to figure
it out.

The code seems to be way too complicated for me to help you much more remotely.

On Fri, May 7, 2010 at 2:48 AM, Nitin Mathur <li...@ruby-forum.com> wrote:
> Hi Rick,
>
> Thanks for reply. Could use of the old version cause this problem?
> Actually I wanted to use the latest version of Rails but that was not
> compatible with the ruby installed in my system and I could not figure
> out which Ruby version was compatible with latest Rails at that time
> (2.3.4).
>
> I my code the instance variable @plat refers to platforms, similarly the
> variable @rel refers to release. So actually I have folders in my
> application that is applicable for some releases and platforms. After
> selecting these platforms and releases a Javascript is called which
> stores the combination of release and platforms and stored in another
> dropdown menu with name platrel with platform name nd release name
> separated by a hyphen ("-") so in controller you will only see the
> variable platrel. I am pasting the controller code below.
>
> Contrller code:
>
>  params[:platrel]['id'].each {|x|
>        pr = ""
>        pr = x.split("\-")
>        platid = Platform.find(:first,:conditions => ['name =
> ?',pr[0].to_s]).id
>        relid = Release.find(:first,:conditions => ['release_name =
> ?',pr[1].to_s]).id
>       �...@newavail = Ownership.find(:first, :conditions => ['folder_id =
> ? and platform_id = ? and release_id = ?  and stop IS NULL and deleted
> IS NULL', params[:f],platid,relid])
>        if @newAvail.blank?
>       �...@ownerships = Ownership.new(
>          :folder_id      => params[:f],
>          :platform_id    => platid,
>          :release_id     => relid,
>          :primary_owner  => @fold_owner.primary_owner,
>          :secondary_owner => @fold_owner.secondary_owner,
>          :created        => Time.new,
>          :start          => Time.new )
>         �...@ownerships.save
>        if (pr[0].to_s != "Any")
>                        anyid = Platform.find(:first,:conditions =>
> ['name = "Any"']).id
>                       �...@anyavail = Ownership.find(:first, :conditions
> => ['folder_id = ? and platform_id = ? and release_id = ?  and stop IS
> NULL and deleted IS NULL', params[:f],anyid,relid])
>                        if @anyAvail.blank?
>                       �...@any_ownerships = Ownership.new(
>                                :folder_id    => params[:f],
>                                :platform_id  => anyid,
>                                :release_id   => relid,
>                                :primary_owner  =>
> @fold_owner.primary_owner,
>                                :secondary_owner =>
> @fold_owner.secondary_owner,
>                                :created        => Time.new,
>                                :start          => Time.new )
>                       �...@any_ownerships.save
>                        end
>        end
>
>        else
>       �...@newavail.stop = 'NULL'
>       �...@newavail.deleted = 'NULL'
>
>
>
>
> Thanks,
> Nitin.
> --
> 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 to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>



-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to