diff --git a/app/helpers/adminsimple/modules/application_helper.rb b/app/helpers/adminsimple/modules/application_helper.rb new file mode 100644 index 0000000..588f44e --- /dev/null +++ b/app/helpers/adminsimple/modules/application_helper.rb @@ -0,0 +1,8 @@ +module Adminsimple::Modules::ApplicationHelper + def rescued_csrf_meta_tags + csrf_meta_tags + rescue ArgumentError + request.reset_session + csrf_meta_tags + end +end diff --git a/app/views/layouts/adminsimple/application.html.haml b/app/views/layouts/adminsimple/application.html.haml index 9817e57..641425e 100644 --- a/app/views/layouts/adminsimple/application.html.haml +++ b/app/views/layouts/adminsimple/application.html.haml @@ -5,7 +5,7 @@ %meta{ charset: "UTF-8" } %meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" } = render partial: "/adminsimple/layout/head" - = csrf_meta_tags + = rescued_csrf_meta_tags :javascript if(typeof Storage !== undefined && localStorage.theme) {document.querySelector('html').setAttribute('id', "adminsimple_" + localStorage.theme);} = stylesheet_link_tag 'adminsimple' diff --git a/app/views/layouts/adminsimple/devise.html.haml b/app/views/layouts/adminsimple/devise.html.haml index 13cf5f4..c26f46e 100644 --- a/app/views/layouts/adminsimple/devise.html.haml +++ b/app/views/layouts/adminsimple/devise.html.haml @@ -4,7 +4,7 @@ %title= t('adminsimple.site_name') %meta{ charset: "UTF-8" } %meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" } - = csrf_meta_tags + = rescued_csrf_meta_tags :javascript if(typeof Storage !== undefined && localStorage.theme) {document.querySelector('html').setAttribute('id', "adminsimple_" + localStorage.theme);} = stylesheet_link_tag 'adminsimple' diff --git a/lib/adminsimple/version.rb b/lib/adminsimple/version.rb index a9a0965..5358f0f 100644 --- a/lib/adminsimple/version.rb +++ b/lib/adminsimple/version.rb @@ -1,3 +1,3 @@ module Adminsimple - VERSION = '0.0.3' + VERSION = '0.0.4' end