harry
harry

Reputation: 85

Errno::ENOENT No such file or directory @ rb_sysopen sinatra wont load views

i have a view in the /app/views/users/signup.html and am calling erb :"users/signup.html" but am getting this error and it seems like sinatra cant find my views folder.

Upvotes: 0

Views: 962

Answers (1)

Pavel Oganesyan
Pavel Oganesyan

Reputation: 6924

You can specify views folder like this

set :views, Proc.new { File.join(root, "templates") }

Documentation: http://sinatrarb.com/configuration.html

I suppose that you should storeviews like/views/users/signup.html - without app folder

Upvotes: 1

Related Questions