Bladeren bron

Shorten rendered links (strip protocol and www, truncate to 30 chars), redirect

to sign in page after sign up instead of root path which redirects to /about
master
Eugen Rochko 7 jaren geleden
bovenliggende
commit
33f7e1cf99
3 gewijzigde bestanden met toevoegingen van 5 en 3 verwijderingen
  1. +1
    -1
      app/controllers/auth/registrations_controller.rb
  2. +3
    -1
      app/lib/formatter.rb
  3. +1
    -1
      spec/lib/formatter_spec.rb

+ 1
- 1
app/controllers/auth/registrations_controller.rb Bestand weergeven

@@ -17,6 +17,6 @@ class Auth::RegistrationsController < Devise::RegistrationsController
end

def after_sign_up_path_for(_resource)
root_path
new_user_session_path
end
end

+ 3
- 1
app/lib/formatter.rb Bestand weergeven

@@ -29,7 +29,9 @@ class Formatter
end

def link_urls(html)
auto_link(html, link: :urls, html: { rel: 'nofollow noopener' })
auto_link(html, link: :urls, html: { rel: 'nofollow noopener' }) do |text|
truncate(text.gsub(/\Ahttps?:\/\/(www\.)?/, ''), length: 30)
end
end

def link_mentions(html, mentions)


+ 1
- 1
spec/lib/formatter_spec.rb Bestand weergeven

@@ -17,7 +17,7 @@ RSpec.describe Formatter do
end

it 'contains a link' do
expect(subject).to match('<a rel="nofollow noopener" href="http://google.com">http://google.com</a>')
expect(subject).to match('<a rel="nofollow noopener" href="http://google.com">google.com</a>')
end
end



Laden…
Annuleren
Opslaan