2

I set up the ConfigFile extension exactly(?) as proposed, but I'm getting the following error:

App 32163 stderr: NoMethodError - undefined method `title' for Testing:Class:

app.rb

# Bundler
require "rubygems"
require "bundler/setup"

# Sinatra
require "sinatra/base"
require "sinatra/config_file"

# Mustache und Markdown
require "mustache/sinatra"
require "rdiscount"


# The app
class Testing < Sinatra::Base
  register Mustache::Sinatra
  register Sinatra::ConfigFile

  require './views/layout'

  config_file './config.yml'

  set :mustache, {
    :views     => './views',
    :templates => './templates'
  }

  get "/" do
    @title = settings.title
    @content = markdown(:content)
    mustache :index
  end
end

config.yml

title: title

Can anybody tell me what I'm doing wrong?

user3094719
  • 297
  • 4
  • 16

1 Answers1

1

Your Problem is that title: title is used as variable and not a string.

To fix this just use title: "title"

Sir l33tname
  • 4,026
  • 6
  • 38
  • 49