similar to: Destroy doesn''t destroy!

Displaying 20 results from an estimated 30000 matches similar to: "Destroy doesn''t destroy!"

2006 Jul 24
4
Destroy action doesn''t work?
Hi all, Here is my Customer controller''s destroy method: ** def destroy Customer.find(params[:id]).destroy redirect_to :action => ''list'' end It''s stock, untouched scaffold code. When I submit the URL: http://localhost:3000/customers/destroy/11 The entry in the MySQL database with id 11 is not destroyed. The destroy method won''t
2006 Feb 27
3
form questions
I have a very simple form that looks allows an input for an error code and then give the show page from the scaffolding if the error code is in the database and a notification on the list page, again from the scaffolding if not. Here''s the form: find.rhtml <h1>Find error</h1> <%= start_form_tag :action => ''search''%> <p><label
2006 Jan 08
4
scaffold uses link_to for destroy
Hi, I wonder why scaffolding uses a link_to tag for the destroy links. Seems like these should be POST requests with button_to. The Rails book dedicates pages 335-337 to this very issue. Peter
2006 Feb 21
0
best practices for simple query
I have a very simple form that looks allows an input for an error code and then give the show page from the scaffolding if the error code is in the database and a notification on the list page, again from the scaffolding if not. Here''s the form: find.rhtml <h1>Find error</h1> <%= start_form_tag :action => ''search''%> <p><label
2009 Jan 05
0
integration test not calling destroy
Hello, I''m writing to describe a problem I ran into, and the solution, which I''ve already found, for posterity''s sake, b/c it took a very long time to figure out. While I don''t consider myself a rails newbie, this does qualify as a rookie mistake. I was having an integration test fail because its call to my one of my app''s destroy controller
2006 Apr 28
9
[AWDR] Tutorial in A4 wont ''destroy'' items
Hello, I''m working through the tutorial, and I''ve run into a little snag. In the first part of the tutorial, the destroy link is not working correctly. I can''t figure out where I goofed. Removing :confirm doesn''t seem to resolve the issue. Thanks, Randy. development.log ----->8----- Processing AdminController#destroy (for 127.0.0.1 at 2006-04-27
2007 Jan 13
2
Help with destroy method - newbie
Hello: I have a destroy method in my controller - pretty standard: def destroy @goal = Goal.find(params[:id]) respond_to do |format| format.html { redirect_to goals_url } format.xml { head :ok } end end And then I have a listing view which has the destroy method in the view - also pretty standard: <%= link_to ''Delete'', { :action =>
2006 Aug 04
4
DRY DRY DRY
Hello everyone! Ive been on rails for the last month or so and really enjoyed this framework. However its very hard to find documentation on how to do things right! For example every beginner after a while realizes that having similar CRUD actions in every controller and views for them is not DRY at all! Few days ago I found http://dereksivers.com/rails-shared-controller.html I quite like his
2006 Aug 17
0
super-newb needs help with has_many and other things...
I am brand new to oop and am having a difficult time getting my head around some ruby stuff. In specific, I am trying to create a library style app that lists topics, articles and comments. I have a table called topics, a table called articles and a table called comments. My models, controller and view are all listed below. What I want to happen is to have the list view list each topic along
2006 Feb 03
1
modifying scaffold method
I''ve made the following changes to scaffolding.rb. Is it possible to put those changes into some type of a plugin or helper or something, instead of directly modifying the Rails source? (and, btw, I think pagination should be removed from scaffolding. And deletes should only happen on post requests. That''s essentially what I''ve changed). Thanks, Joe Index:
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so it can handle redirects in rjs calls? I''ve done something like this in my app controller, seems to work ok... alias_method :redirect_to_orig, :redirect_to; def redirect_to(options = {}, *parameters_for_method_reference) respond_to do |accepts| accepts.html do redirect_to_orig
2005 Dec 28
1
Instance variables don''t persist between actions?
Following a simple example of the Rails book and using scaffolding I got a simple application to manage a user database. the controller is like: def new @user = User.new @text = "Hello World" end def create @user = User.new(params[:user]) if @user.save flash[:notice] = ''User was successfully created.'' redirect_to :action =>
2006 Jun 22
0
sortable list doesn''t work on production server
I have a sortable list in one of my views, using the sortable example from the recipes book. The sorting works great on my mac. When I throw it on the server for testing it doesn''t save the display order. I cracked open the log file and see that it''s not even returning the id''s like it should: Parameters: {"action"=>"sort",
2006 Jun 20
0
No opening form tag in rendered HTML
I cannot get my form to submit for my simple blog site (based on the "How to Build a Blog Engine in 15 Minutes" presentation) Any ideas? Thanks, Tom ---------------------------------------------------------------------------- Here is my code: #Post controller class PostsController < ApplicationController def index list render :action => ''list'' end
2006 Dec 28
1
Default Scaffolding Gives Errors
This is the default scaffolding for list.rhtml: [code] <h1>Listing <%= @scaffold_plural_name %></h1> <table> <tr> <% for column in @scaffold_class.content_columns %> <th><%= column.human_name %></th> <% end %> </tr> <% for entry in instance_variable_get("@#{@scaffold_plural_name}") %> <tr> <% for
2012 May 08
1
One to many relationships
I was trying to make one to many relationships - between professors controller to rate_professors controller and used scaffold. it''s giving me this error- NoMethodError in RateProfessorsController#index undefined method `rate_professors'' for nil:NilClass app/controllers/rate_professors_controller.rb:7:in `index'' Request Parameters:
2006 Mar 13
1
has_many.collection<<obj doesn''t set attributes?
I tried: @item.stuff<<thing and in thing I have: def stuff_id=(value) # remember old stuff_id cuz Rails has lousy trigger equivalent logger.debug ''set stuff_id called'' end And apparently stuff_id doesn''t get called, but the fk is changed directly in the database? I''m about to abandon trying to do trigger related stuff in Rails and go back to
2007 Jan 15
2
Help with with displaying a selected list.
Hello. I call a find_all_by_subject("action") which returns 2 videos and displays them properly. But when I add @video_pages, @videos = paginate :videos, :per_page => 10 so I can paginate the videos, it displays ALL the videos as if I selected list videos. Can someone please tell me what I am doing wrong? Thank you. selectaction.rhtml <table> <tr> <% x = 0 %>
2006 Jan 05
2
help - edit without using scaffold
Hello, What am I doing wrong? The code below does not show the current record for editing. def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) flash[:notice] = ''User was successfully updated.'' redirect_to :action => ''show'', :id => @user else render :action
2006 Jul 26
3
newbie: Scaffold doesn''t pickup DB changes
I''m following along with the depot example in ''Agile Web Development'' and ran into a problem with Scaffold. I changed the MySQL table structure to add a few columns directly and also tried the migrate script to change the database after I got the initial scaffolding to work. However, I can''t seem to get the new columns to show up and am stumped as to how I can