Changeset 123
- Timestamp:
- 12/12/04 13:48:58 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_view/helpers/active_record_helper.rb
r114 r123 52 52 def form(record_name, options = {}) 53 53 record = instance_eval("@#{record_name}") 54 action = url_for(:action => options[:action] || (record.new_record? ? "create" : "update")) 55 submit_value = options[:submit_value] || action.gsub(/[^\w]/, '').capitalize 54 55 options[:action] ||= record.new_record? ? "create" : "update" 56 action = url_for(:action => options[:action]) 57 58 submit_value = options[:submit_value] || options[:action].gsub(/[^\w]/, '').capitalize 56 59 57 60 id_field = record.new_record? ? "" : InstanceTag.new(record_name, "id", self).to_input_field_tag("hidden") 58 61 59 %(<form action="#{action}" method=" POST">#{id_field}) +62 %(<form action="#{action}" method="post">#{id_field}) + 60 63 all_input_tags(record, record_name, options) + 61 64 %(<input type="submit" value="#{submit_value}" /></form>)