I create the project in scaffold but I cant able to edit it and update
th values

I gort the error in no action required I attach the image bellow
and my codeing the controller is :

@department = Department.find(params[:id])

respond_to do |format|
if @department.update_attributes(params[:departments])
flash[:notice] = 'Department was successfully updated.'
format.html { redirect_to(@department) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @department.errors, :status =>
:unprocessable_entity }
end
end

Attachments:
http://www.ruby-forum.com/attachment/8184/edit.jpg


--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Colin Law at Feb 28, 2013 at 2:54 pm

    On 28 February 2013 13:37, vasanth k. wrote:
    I create the project in scaffold but I cant able to edit it and update
    th values
    I guess you are a beginner in Rails. If so then I suggest that you
    work right through a good tutorial such as railstutorial.org, which is
    free to use online. That will show you the basics of Rails.

    Once you have done that, if you still get the problem, and still
    cannot work it out then have a look at the Rails Guide on Debugging,
    which will show you techniques that can be used to debug your code.

    If you have to post messages in future then please paste them in as
    text rather than an image. It is easier to follow the thread if
    everything is in the message.

    Colin
    I gort the error in no action required I attach the image bellow
    and my codeing the controller is :

    @department = Department.find(params[:id])

    respond_to do |format|
    if @department.update_attributes(params[:departments])
    flash[:notice] = 'Department was successfully updated.'
    format.html { redirect_to(@department) }
    format.xml { head :ok }
    else
    format.html { render :action => "edit" }
    format.xml { render :xml => @department.errors, :status =>
    :unprocessable_entity }
    end
    end

    Attachments:
    http://www.ruby-forum.com/attachment/8184/edit.jpg


    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 28, '13 at 1:37p
activeFeb 28, '13 at 2:54p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Colin Law: 1 post Vasanth k.: 1 post

People

Translate

site design / logo © 2021 Grokbase