high-voltage

Rails - HighVoltage gem - link with anchor

左心房为你撑大大i 提交于 2020-03-26 15:29:48
问题 I have a problem with HighVoltage when I try to link to anchor on the static page. In the URL I am receiving '%23' instead of '#'. Example <%= link_to 'xxx', page_path('xxx#yyy') %> gives in the URL: http://localhost:3000/pages/xxx%23yyy Can somebody give ma a hint how it can be solved, as I did not find any related information in the gem documentation. 回答1: You must need to and the param anchor, for example: link_to "About", page_path('index', anchor: "about") 来源: https://stackoverflow.com

Using ERB in Markdown with Redcarpet

岁酱吖の 提交于 2019-12-06 05:13:43
问题 I'm trying to get Markdown to play nicely with .erb. I'd like to use high_voltage to render markdown pages (or normal .html.erb files with markdown partials) that are parsed with Redcarpet and am struggling to get it to all work together. At the moment I have an initializer called markdown_template_handler.rb that contains the following code: class MarkdownTemplateHandler def erb @erb ||= ActionView::Template.registered_template_handler(:erb) end def call(template) compiled_source = erb.call

Render partial from static page

≯℡__Kan透↙ 提交于 2019-12-04 06:11:47
问题 I'm trying to render a partial in my main welcome page (i used HighVoltage gem to create it), my Groups form, where the user can create a new group... what i've tried so far gives me the following error... First argument in form cannot contain nil or be empty = form_for @group do |f| .fieldset - if @group.errors.any? .error_messages My routes are configured like this Giraffle::Application.routes.draw do get 'sign_up', to: 'groups#new', as: 'sign_up' get 'sign_in', to: 'sessions#new', as:

Render partial from static page

梦想与她 提交于 2019-12-02 08:43:25
I'm trying to render a partial in my main welcome page (i used HighVoltage gem to create it), my Groups form, where the user can create a new group... what i've tried so far gives me the following error... First argument in form cannot contain nil or be empty = form_for @group do |f| .fieldset - if @group.errors.any? .error_messages My routes are configured like this Giraffle::Application.routes.draw do get 'sign_up', to: 'groups#new', as: 'sign_up' get 'sign_in', to: 'sessions#new', as: 'sign_in' delete 'sign_out', to: 'sessions#destroy', as: 'sign_out' resources :sessions resources :members