Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url method raises an error if I don't have the root method in my model - padrino framework #227

Closed
ipoval opened this issue Feb 28, 2011 · 1 comment

Comments

@ipoval
Copy link

ipoval commented Feb 28, 2011

def url
if file.respond_to?(:url) and not file.url.blank?
file.url
elsif current_path
File.expand_path(current_path).gsub(File.expand_path(root), '')
end
end

File.expand_path(root) raises an error since root is nil, if I don't define the root method in my model.

I was using the padrino framework + sequel. I suspect that I need to supply some additional configuration hash, but it was not obvious for me why it didn't work by default. If this is my configuration issue, probably, it worth mentioning in the docs the need for some additional config. options.

Thanks, Ivan Povalyukhin

@trevorturk
Copy link
Contributor

Sorry, but I don't understand what the problem is here. Can you please provide a code example in a gist or something legible? Also, please describe what the problem you're having is in detail.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants