Add to Rails template libraries.
Sorcery is fantastic. I’ve worked on a few Rails implementations. These services could spread the love.
https://www.rubidium.io/
https://railsbytes.com/
I see Devise listed. Any interest in setting up some templates? 👍
I have my own rails template setup that includes Sorcery, but it's more specialized for my own re-usability needs: athix/rails-template
I like this idea, but don't have time to implement it personally. Maybe someone could take an existing template and make a more general Sorcery template?
Hi guys ! I'd be glad to help on this :D I am not completely sure about what you want : a template available from a website ? Or a rails boilerplate with Sorcery that people could just re-use ? Or both 🤷♂️
I never created a template from railsbytes, so I'd just give it try with something like this, based on the one for Devise and Sorcery's doc :
run "bundle add sorcery"
run "bundle install"
rails_command "generate sorcery:install"
model_name = ask("What do you want to call your Sorcery model?")
attributes = ""
if yes?("Do you want to any extra attributes to #{model_name}? [y/n]")
attributes = ask("What attributes?")
end
# We don't use rails_command here to avoid accidentally having RAILS_ENV=development as an attribute
run "rails generate sorcery:install --model #{model_name} #{attributes}"
Hi everyone, I see this issue hasn't moved in a while and I wanted to try my hand at it. I've created a Sorcery template here: https://github.com/ditsara/sorcery-rails-template
Basically all you need is the template.rb file (I've combined all the generated files into it).
Can I get your feedback? I've only done some light testing so far.
@ditsara I took a quick look, and one thing I would consider is moving from inline templates within template.rb, to copying template files. You can also apply other files to split it up into logical chunks.
Okay, I see. Is there any convention around this? IE to ensure it works when fetching via HTTP vs local.
I'll take another look this coming weekend.
Yeah, the methods I mentioned are built-in iirc, and work when using it in either remote fetch or local.