after record create , the redirect to admins_partners_url is working
fine ( :index displaying the page)
but after the update , the record update is performed , but I get this
error

.......`updated_at` = '2012-01-18 14:57:08' WHERE `partners`.`id` = 7
(10.1ms) COMMIT
Redirected to http://lvh.me:3000/admins/partners
Completed 406 Not Acceptable

same url... on create and update

def create
@partner = Partner.new(params[:partner])
if @partner.save
flash.now[:notice] = t(:partner_added)
redirect_to admins_partners_url


def update
@partner = Partner.find(params[:id])
respond_to do |format|
if @partner.update_attributes(params[:partner])
flash.now[:notice] = t(:partner_updated)
redirect_to admins_partners_url

I don't get it ...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Erwin at Jan 18, 2012 at 3:51 pm
    [SOLVED] sorry for posting too fast ... pasting my code , I just
    noticed that I had a
    respond_to do |format| block in my update code ..... removing it did
    the trick !

    I don't understand yet why .. but I'll do some search about it ....
    On Jan 18, 4:44 pm, Erwin wrote:
    after record create , the redirect to admins_partners_url  is working
    fine  ( :index displaying the page)
    but after the update , the record update is performed , but I get this
    error

    .......`updated_at` = '2012-01-18 14:57:08' WHERE `partners`.`id` = 7
    (10.1ms)  COMMIT
    Redirected tohttp://lvh.me:3000/admins/partners
    Completed 406 Not Acceptable

    same url... on create and update

    def create
    @partner = Partner.new(params[:partner])
    if @partner.save
    flash.now[:notice] = t(:partner_added)
    redirect_to admins_partners_url

    def update
    @partner = Partner.find(params[:id])
    respond_to do |format|
    if @partner.update_attributes(params[:partner])
    flash.now[:notice] = t(:partner_updated)
    redirect_to admins_partners_url

    I don't get it ...
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 18, '12 at 3:44p
activeJan 18, '12 at 3:51p
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Erwin: 2 posts

People

Translate

site design / logo © 2022 Grokbase