framework_trace

framework_trace() Instance Public methods

has_attribute?

has_attribute?(attr_name) Instance Public methods Returns true if the given attribute is in the attributes hash, otherwise false. class Person < ActiveRecord::Base end person = Person.new person.has_attribute?(:name) # => true person.has_attribute?('age') # => true person.has_attribute?(:nothing) # => false

assert_select_encoded

assert_select_encoded(element = nil, &block) Instance Public methods Extracts the content of an element, treats it as encoded HTML and runs nested assertion on it. You typically call this method within another assertion to operate on all currently selected elements. You can also pass an element or array of elements. The content of each element is un-encoded, and wrapped in the root element encoded. It then calls the block with all un-encoded elements. # Selects all bold tags fr

register

register(*t) Class Public methods

to_xml

to_xml(options = {}, &block) Instance Public methods Returns XML representing the model. Configuration can be passed through options. Without any options, the returned XML string will include all the model's attributes. user = User.find(1) user.to_xml <?xml version="1.0" encoding="UTF-8"?> <user> <id type="integer">1</id> <name>David</name> <age type="integer">16</age> <created-at type="dateTime">2011-01-30T22:29:23

hide_action

hide_action(*args) Instance Public methods Sets all of the actions passed in as hidden actions. Parameters args - A list of actions

to_default_s

to_default_s(format = :default) Instance Public methods Alias for: to_s

translate_exception

translate_exception(exception, message) Instance Protected methods

submit

submit(value=nil, options={}) Instance Public methods Add the submit button for the given form. When no value is given, it checks if the object is a new resource or not to create the proper label: <%= form_for @post do |f| %> <%= f.submit %> <% end %> In the example above, if @post is a new record, it will use âCreate Postâ as submit button label, otherwise, it uses âUpdate Postâ. Those labels can be customized using I18n, under the helpers.submit key and accept

to_str

to_str() Instance Public methods Equivalent to to_s.