method
create

Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Object
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9 (0)
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
Related methods
- Class methods (1)
-
lookup_missing_generator (<= v2.3.8)
- Instance methods (58)
-
` (<= v5.2.3)
-
acts_like?
-
app (<= v3.1.0)
-
as_json
-
blank?
-
bundler? (<= v3.2.13)
-
class_eval (<= v2.3.8)
-
controller (<= v3.1.0)
-
copy_instance_variables_from (<= v3.0.9)
-
create (<= v3.0.9)
-
create_fixtures (<= v5.1.7)
-
deep_dup
-
destroy (<= v3.0.9)
-
duplicable?
-
edit (<= v3.0.9)
-
extended_by (<= v2.3.8)
-
extend_with_included_module... (<= v2.3.8)
-
helper (<= v3.1.0)
-
html_safe?
-
in?
-
index (<= v3.0.9)
-
instance_exec (<= v2.3.8)
-
instance_values
-
instance_variable_defined? (<= v2.3.8)
-
instance_variable_names
-
itself (<= v4.2.9)
-
load (<= v2.1.0)
-
metaclass (<= v2.3.8)
-
new (<= v3.0.9)
-
new_session (<= v3.1.0)
-
options (<= v3.2.13)
-
presence
-
presence_in
-
present?
-
progress_bar
-
rake (<= v3.0.9)
-
reload! (<= v3.1.0)
-
remove_subclasses_of (<= v2.3.8)
-
require (<= v2.1.0)
-
returning (<= v3.0.9)
-
root_dir (<= v3.0.9)
-
run_all! (<= v3.2.13)
-
show (<= v3.0.9)
-
singleton_class (<= v2.3.8)
-
subclasses_of (<= v2.3.8)
-
tap (<= v2.3.8)
-
test_homepage (<= v3.2.13)
-
to_json (<= v4.0.2)
-
to_json_with_active_support... (<= v4.2.9)
-
to_param
-
to_query
-
try
-
try!
-
unescape (<= v6.1.7.7)
-
unloadable (<= v2.1.0)
-
update (<= v3.0.9)
-
with
-
with_options
= private
= protected
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v3.0.9) is shown here.
These similar methods exist in v7.1.3.2:
- ActiveRecord::Relation#create
- ActiveSupport::TimeZone#create
- ActionDispatch::Request::Session#create
- ActiveRecord::Associations::CollectionProxy#create
- ActiveRecord::Tasks::MySQLDatabaseTasks#create
- ActiveRecord::Tasks::PostgreSQLDatabaseTasks#create
- ActiveRecord::Tasks::SQLiteDatabaseTasks#create
- ActiveRecord::Tasks::DatabaseTasks#create
- ActiveRecord::Associations::AliasTracker#create
- ActiveRecord::Delegation::ClassMethods#create
- ActiveRecord::Reflection#create
- ActiveRecord::Associations::AssociationScope#create
- ActiveRecord::StatementCache#create
- Rails::Application#create
- ActionDispatch::Response#create
- ActionDispatch::TestRequest#create
- ActionView::Digestor::Node#create
- ActiveRecord::ConnectionAdapters::DatabaseStatements#create
- ActionController::TestRequest#create
- ActiveRecord::Associations::Association#create
- ActiveRecord::ConnectionAdapters::SchemaDumper#create
- ActiveStorage::DirectUploadsController#create
- ActiveRecord::Persistence::ClassMethods#create
- ActionMailbox::Ingresses::Mailgun::InboundEmailsController#create
- ActionMailbox::Ingresses::Mandrill::InboundEmailsController#create
- ActionMailbox::Ingresses::Postmark::InboundEmailsController#create
- ActionMailbox::Ingresses::Relay::InboundEmailsController#create
- ActionMailbox::Ingresses::Sendgrid::InboundEmailsController#create
create()
public POST <%= route_url %>.xml
Show source
# File railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb, line 42 def create @<% singular_table_name %> = <% orm_class.build(class_name, "params[:#{singular_table_name}]") %> respond_to do |format| if @<%= orm_instance.save %< format.html { redirect_to(@<%= singular_table_name %>, :notice => '<%= human_name %> was successfully created.') } format.xml { render :xml => @<% singular_table_name %>, :status => :created, :location => @<% singular_table_name %> } else format.html { render :action => "new" } format.xml { render :xml => @<% orm_instance.errors %>, :status => :unprocessable_entity } end