On 4 November 2010 11:23, Kostas L. <loup...@gmail.com> wrote:
> Hello,
> i have a strange problem here. I have made a teacher controller using
> scaffold. All actions work fine but the delete does not. When i click
> the delete link, it redirects me to the edit of this teacher. I have
> restarted the server and i have tried in firefox (i use chrome) but
> problem still remains. Here is the code from my view.

Have a look in the log file (log/development.log) to see what is
logged when you click the link

Colin

>
>   <%= link_to(image_tag("/images/
> delete_icon.jpg",:size=>"20x20",:border=>"0"), teacher, :confirm =>
> 'Are you sure?', :method => :delete)%>
>
> also tried but i get the same action
>
>   <%= link_to 'Delete', teacher, :confirm=>"Are you
> sure?", :method=>:delete %>
>
> The teacher_controller action is:
>  # DELETE /teachers/1
>  # DELETE /teachers/1.xml
>  def destroy
>   �...@teacher = Teacher.find(params[:id])
>   �...@teacher.destroy
>    respond_to do |format|
>      format.html { redirect_to(teachers_url) }
>      format.xml  { head :ok }
>    end
>  end
>
> In the routes i only use resources :teachers.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to