Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 876057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:22:14+00:00 2026-05-15T11:22:14+00:00

1st Question: I’m trying to make the create method work, but it appears that

  • 0

1st Question:

I’m trying to make the create method work, but it appears that my form is sending data innapropriately to my DB. This is the server.log :

Processing Admin::AdminWysisController#create (for ::1 at 2010-06-22 13:43:58) [POST]
Parameters: {"commit"=>"save", "action"=>"create", "authenticity_token"=>"P8pW7GnSNr7RZcxFcejpfsu9YCX7z8hO0DJPH3rYalQ=", "controller"=>"admin/admin_wysis", "admin_wysi"=>{"post_published"=>"<p>\r\n\tstinky</p>\r\n"}}
User Columns (2.0ms)   SHOW FIELDS FROM `users`
User Load (0.3ms)   SELECT * FROM `users` WHERE (`users`.`id` = '1') LIMIT 1
SQL (0.1ms)   BEGIN
User Update (0.2ms)   UPDATE `users` SET `updated_at` = '2010-06-22 17:43:58', `perishable_token` = 'XMxt1yi5_4JEwPP-21GO', `last_request_at` = '2010-06-22 17:43:58' WHERE `id` = 1
SQL (0.4ms)   COMMIT
AdminWysi Columns (1.0ms)   SHOW FIELDS FROM `admin_wysis`
SQL (0.1ms)   BEGIN
AdminWysi Create (0.1ms)   INSERT INTO `admin_wysis` (`post_published`) VALUES(NULL)
SQL (0.4ms)   COMMIT
Redirected to http://localhost:3000/admin/admin_wysi
Completed in 139ms (DB: 5) | 302 Found [http://localhost/admin/admin_wysi]
SQL (0.1ms)   SET NAMES 'utf8'
SQL (0.1ms)   SET SQL_AUTO_IS_NULL=0

The most important part of that statement is this one :

"admin_wysi"=>{"post_published"=>"<p>\r\n\tasdfasdfasd</p>\r\n"}

Which should be just simply :

 "post_published"=> "<p>\r\n\tasdfasdfasd</p>\r\n"

Let’s look at my view..

- form_for @admin_wysi, :url => admin_admin_wysi_path do |f|
    = f.error_messages :header_message => FORM_ERROR_HEADER_MESSAGE, :message => FORM_ERROR_MESSAGE
    = f.cktext_area :post_published, :cols => '70', :rows => '30', :width => '555px', :height => '240px', :toolbar => 'HQ'
    %br/
.grid_2.prefix_5.align_right
  = f.submit 'save', {:class => 'button'}

Here is my controller 😀

def new
 @admin_wysi = AdminWysi.new
end

def create
  @admin_wysi = AdminWysi.new(params[:admin_wysi])
  if @admin_wysi.save
    redirect_to admin_admin_wysi_path
 end
end

Any idea what might be bugging this?

2nd Question

Strange as it is, when it saves, it redirects me to website.com/wysi NOT website.com/wysis/ . The latter one is a working link, the prior is not a real link.

My routes.rb looks like this :

map.namespace :admin do |admin|
  admin.resource :admin_wysi
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:22:15+00:00Added an answer on May 15, 2026 at 11:22 am

    The params you’re getting are what’s expected in a Rails app. Otherwise, there would be no good way to access only the parameters that are part of the object to the save (for instance, to discard the commit, action, etc. key/value pairs). What errors are you getting from the create action? If it’s redirecting you, it seems like it is probably not getting errors while saving.

    As to your routing problem, the reason you’re getting the singular (wysi) rather than plural (wysis) is that you’re using map.resource instead of map.resources. If you change that, I believe it should fix the routing problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 479k
  • Answers 479k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may want to try the following: SELECT t2.name FROM… May 16, 2026 at 5:45 am
  • Editorial Team
    Editorial Team added an answer The solution that i have choose for this is table… May 16, 2026 at 5:45 am
  • Editorial Team
    Editorial Team added an answer You should be able to do: html { overflow: auto;… May 16, 2026 at 5:45 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.