You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: