Activity
Posted in Why is this image_tag not working?
I've just hit this same issue. Did you ever solve it?
Ok so I've only just read in to JWT. Seems using the Knock gem, this might be the best way for me to authorise users based on my own user model, espeically as it appears it will also be suitable for mobile app too.
So I've got a fairly basic CRUD style rails app, which has a list of Gins
, Distilleries
and and blog Posts
.
I'd like to expand it quite significantly in the following ways:
- Add authenticated users To allow users to interacat with
Gins
. e.g. be able to favorite, add to wish list, rate and gamification etc - Add a user dashboard The dashboard would display the above interactions, and also a feed of all users interactions
- Build native mobile apps I hear mobile is the future ;) but to also allow for the below:
- User uploads of gin photos I want to have a monthly activity where users have to find gins based on some hints, and they can then upload the gins that they find.
So, this has really got my head aching, and feels wayyyyyy beyond my capabilities, but hey...
I have some main questions:
What can I use for user authentication, so that a user can login in to the app, and also web clients? Good ole' Devise? Google Firebase, AWS Cognito, Oauth perhaps Okta.
If I use something other than Devise, how and where would I store the user data for likes for example that a user might make in the web client and/or the mobile app.
I'd like to keep 'standard' rails app for my static pages and the blog, (so easy to do in rails, plus SEO advantages) but am thinking of building a seperate VueJS app for the dashboard. I would render Gin and Distilleries in json API, which could also be access via the mobile apps.
Appreciate this is a big quetsion, and will have many opnions, but any thoughts or comments would be appriciated as my brain hurts and my girlfriend doesn't care to be a soundboard.
Old post I know but it's quite a general question so will add my thoughts.
My decision making has always come down to whether there will only ever be one category
, or potential multiple categories
. For the singular, you can probably just add a column in your model, but for multiple entries, you might want to create a seperate category model, and then reference the two via a joins table.
This approach is very common for tags for example, but to be honest, I've started using it in many areas that can have multiple entries. e.g. flavours in coffee or different gin brands served by a bar.
At the end of the day, it's all just a type of tagging.
Posted in Facets with Searchkick
@Caio. Your code just helped me out too. Thanks,
Have you ran $ rails active_storage:install
which generates a migration to add the two new tables active_storage_attachments
and active_storage_blobs
? You'll of course also need to then run $ rails db:migrate
.
Posted in Reputation Gems - Merit
I was looking at reputation gems, and it seems Merit could be a good choice.
Quick Question though, can you add this to existing User models? Or does it need to generate it's own?
From their guides:
rails g merit MODEL_NAME (e.g. user). This creates a migration and adds has_merit to MODEL_NAME.
Posted in Login with Facebook Discussion
That's a very interesting article, and also the one referenced within in. I hadn't thought too much about it making sites look like the side of a Nascar. Either way, I think I'll leave it out of my sign_up process for the time being.
I've had that issue before when copying code from Medium for example. You get in the habit of looking for it after a while, but it does also highlight it can be better to write out the code which helps you to understand it opposed to just copy and pasting.
Posted in Login with Facebook Discussion
With more and more concerns over the security and usage of user data at Facebook, does anyone have second thoughts about providing Facebook as an option?
Moved tailwaindcss to dependencies instead of devDependencies in package.json
Module build failed: Error: Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
- Have you migrated the additional columns to your user model? e.g. 'provider', 'uid'?
- Have you also added your app details in config/initializers/devise.rb?
- config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'], scope: "email", info_fields: 'email, first_name, last_name'
Just needed to run:
eb setenv RAILS_SERVE_STATIC_FILES=enabled
I'm getting a 404 on both the application.css and application.js
application-a5cbbd551a90e5fa75fc8997e17a9236.css Failed to load resource: the server responded with a status of 404 (Not Found)
Looks like it did compile, as I'm not getting this error in the logs:
ERROR in ./node_modules/css-loader??ref--1-2!./node_modules/postcss-loader/lib??ref--1-3!./app/javascript/css/application.css
Module build failed: Error: Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
I've managed to do a successful deploy to beanstalk with the following in `.ebextensions`. Although I have no CSS styling in the production app. One step forwards!
commands: 01_install_yarn: command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install yarn -y" 02_download_nodejs: command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - 03_install_nodejs: command: yum -y install nodejs
Webpacker requires Node.js >= 6.0.0 and you are using 4.6.0
Does anyone know where/how I can upgrade my Node version?
Module not found: Error: Can't resolve '../css/application.css'