Skip to content

Instantly share code, notes, and snippets.

@jasonleonhard
Created May 20, 2015 16:26
Show Gist options
  • Save jasonleonhard/f4c05ab712388c878bc0 to your computer and use it in GitHub Desktop.
Save jasonleonhard/f4c05ab712388c878bc0 to your computer and use it in GitHub Desktop.
rails whitespace syntax error
# this one will not work, it creates a syntax error
class ArticlesController < ApplicationController
def new
end
  
def create
render plain: params[:article].inspect
  end
end
but this does work...
class ArticlesController < ApplicationController
def new
end
def create
render plain: params[:article].inspect
end
end
@jasonleonhard
Copy link
Author

articles_controller.rb:8: syntax error, unexpected end-of-input, expecting keyword_end

@jasonleonhard
Copy link
Author

<%- and -%> suppress leading and trailing whitespace
Is this required to not receive the unicode characters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment