absolute_url(:posts, :index)
resolves to a more specific route like /posts/:year/:month
and errors out with Mustermann::ExpandError: cannot expand with keys [], possible expansions: [:year, :month]
. Apologies if there is some documentation/migration guide out there that I missed that addresses this. Thank you for your time.
:index
and the old router it seems would disambiguate based on request method and params?
Demo::App.controllers :posts do
get :index do; end # /posts
get :index, with: :id do; end # /posts/:id
get :index, with: [:year, :month] do; end # /posts/:year/:month
post :index do; end # /posts
patch :index, with :id do; end # /posts/:id
delete :index, with: :id do; end # /posts/:id
end
absolute_url(:posts, :index)
to resolve to /posts
I am new to ruby (like couple weeks new) and trying to implement omniauth-okta but getting the following error "OmniAuth::Strategies::OAuth2::CallbackError at /auth/okta/callback
csrf_detected | CSRF detected" I have know clue as how to proceed
set :public_folder, PADRINO_ROOT + '/public'
in the app.rb file in each sub-app - then the sub-app looks at the same 'public' folder as the main app, and I don't have to specify a hard path to the :layout each time.
before route_regex do ... end
inside of a configure block in app.rb
. It appears to set up stuff to do before going to routes that match the regex in any of the controllers, but I'm not clear on how this works. Can anyone point me to the documentation on that, or shed some light on it for me?
MyProject::App.mailer :error do
email :notify do |report|
from 'noreply@domain.com'
to 'sistemas@domain.com'
to 'soporte@domain.com' if Padrino.env == :production
subject "Error #{report.code}: #{report.message}"
content_type 'text/html'
render :report, layout: :mail, locals: { report: report }
end
end
gem 'sinatra', '2.0.8.1'
in your Gemfile and see if that eliminates the error about Mailer.