Displaying 3 results from an estimated 3 matches for "entity_name".
2008 Apr 08
1
Help with primary_key_prefix_type
...his config in environment.rb
# Use table_id instead of id for primary key.
config.active_record.primary_key_prefix_type =
:table_name_with_underscore
I have this migration:
class CreateEntities < ActiveRecord::Migration
def self.up
create_table :entities do |t|
t.string :entity_name, :null => false,
:limit => 40
t.string :entity_legal_name, :null => false,
:limit => 120
t.string :entity_legal_form, :null => false,
:limit => 4
t.timestamps
end
add_inde...
2008 Mar 08
9
Validation error handling on related models
...entity = Entity.new
respond_to do |format|
# new.html.erb
format.html { render :template => ''clients/edit.html.erb'' }
format.xml { render :xml => @client }
end
end
In models/entity.rb I have the following validation:
validates_presence_of :entity_name,
:message => "The name may not be blank.
The file views/clients/edit.html.erb has the following code:
<h1>Editing client <%= @entity.id unless @entity.new_record? %></h1>
<%= error_messages_for :client %>
<% form_for(@client) do |cu| %>
<% fields_f...
2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
One of my controllers directly renders some JSON output that I would
like to test with RSpec. For that I use ''response.should
have_text("foobar")'' in my spec file, but that leads to a
Failure/Error: response.should have_text("enim")
undefined method `has_text?'' for #<ActionController::TestResponse:
0xb6736944>
I read here somewhere that webrat