Displaying 2 results from an estimated 2 matches for "software_ci".
2008 Jan 08
0
Error in validation
I have the following model
===========================
class SoftwareCi < ActiveRecord::Base
has_one :ci, :as => :content
has_one :primary_group
validates_presence_of :name, :message => "can''t be empty"
end
The controller
================
def create
@software_ci= SoftwareCi.new(params[:ci])
redirect_to :action => ''create_ui''
end
The rhtml, create_ui, I have given the following
=======================
<% unless @software_ci.errors.empty? %>
Error occurred!
<ul>
<% @software_ci.errors.each_full do |message| %&...
2008 Jan 02
6
problem when editing record in polymorphic relation
...==================
id | ci_number | content_id | content_type
----+----------+-----------+------------+--------------
1 | CI1 | 1 | SoftwareCi
2 | CI2 | 2 | SoftwareCi
3 | CI3 | 1 | HardwareCi
4 | CI4 | 2 | HardwareCi
The table, software_cis ,contains the following records
=====================================================
id | asset_tag | status | version
----+-------------------+---------+---------
1 | AC Logix - AT1 | Status2 | 1.0
2 | RR Logix AT2 | Status3 | 2.3
The table, hardware_cis ,contains the fol...