Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <%= form_for :client, :url => clients_url, :html => { :method => :post } do |f| -%>
  2. <p>Client Name:<br/><%= f.text_field :client_name, :size => 60 %></p>
  3. <%= submit_tag 'Save' %>
  4. <% end -%>
  5.  
  6. def create
  7. @client = Client.new(params[:client])
  8. @client.save!
  9. flash[:notice] = 'Client saved'
  10. redirect_to :action => 'index'
  11. rescue ActiveRecord::RecordInvalid
  12. render :action => 'new'
  13. end
  14.  
  15. match ':controller(/:action(/:id))(.:format)'
  16. resources :clients
  17.  
  18. Started POST "/clients" for 127.0.0.1 at Wed Sep 12 10:37:31 +0800 2012
  19. Processing by ClientsController#index as HTML
  20. Parameters: {"commit"=>"Save", "authenticity_token"=>"fWBMy8fzGo1BHwm5yN/oXClUUfy+pS2R4Z2Hhzu2/20=", "utf8"=>"342234223", "client"=>{"client_name"=>"wefw"}}
  21. [1m[35mClient Load (0.2ms)[0m SELECT "clients".* FROM "clients"
  22. Rendered clients/index.html.erb within layouts/application (0.6ms)
  23. Rendered layouts/_menu.html.erb (0.1ms)
  24. Completed 200 OK in 14ms (Views: 12.4ms | ActiveRecord: 0.2ms)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement