SitePoint Sponsor

User Tag List

Results 1 to 17 of 17

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A second set of eyes

    Could someone please look over the following code and inform me of what I've stupidly done to receive this error: argumets_controller .rb:49: syntax error, unexpected kEND, expecting $end

    Code Ruby:
    class ArgumentsController < ApplicationController
        before_filter :login_required
     
        def create
            @argument = Argument.create!(params[:argument])
     
            flash[:notice] = 'You have now argued your case'
     
            respond_to do |format|
                format.html
                format.js
            end
        end
     
        def show
            @argument = Argument.find(params[:id])
     
            respond_to do |format|
                format.html
                format.js
            end
        end
     
     
        def destroy
            @argument = Argument.find(params[:id])
     
            if is_creator?
                @argument.destroy
     
                flash[:notice]    =    'Your argument has been removed'
                respond_to do |format|
                    format.html { redirect_to :back }
                    format.js
                end
            else 
                flash[:notice] = 'That\'s not your own argument you\'re trying to delete fool'
                redirect_to :back
            end
        end
     
        protected
        #Check is user is allowed to edit and update options of this debate.
        def is_creator?
            if argument_creator? 
                true
            else
                false            
            end
        end    
     
    end
    Last edited by crankin; Jul 30, 2009 at 21:02. Reason: Wrong code


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •