Front end and Back end Folder are missing - ruby-on-rails

I have install Spree ecommerce following this link
https://guides.spreecommerce.org/developer/getting_started_tutorial.html
all are work but canot find out the backend and frontend folder.
Can anyone teach me how to show or find out all the controller in Back end and front end

Since Spree 3.4 you can copy views (turned on by default).
rails g spree:install --migrate=false --sample=false --seed=false --copy_views=false
If you have an older version then you have to copy views from GitHub Spree repo.

Related

Letter opener web returns Errno::ENOENT on dev env

In rails, I'm building a confirmable method for users when they sign-up with Devise Confirmable model. To check to see the letters drop in the inbox I installed the letter opener web gem and followed all the instructions here for letter opener web gem. We are using rails 7 and ruby 3.1 versions and running docker. And when I navigate to /mail, I get this error
Errno::ENOENT
Checked the letters with ls tmp/letter_opener if they are populated and I can confirm that all the folders are there.
How can I fix this error? Not sure what am I missing here. Thank you sincerely for all the help already.
After running this command open tmp/letter_opener and I can confirm that the file on the error page that was missing was actually in tmp/letter_opener folder. But contents of that the mail folder 1665782476_873833_996e302 was empty and rails was looking for a .html file in there so that's why it was erroring out. I cleaned everything in the tmp/letter_opener folder and navigated to /mail and could successfully render the letter opener web interactive view.

Multiple reactjs applications that can share components

I am creating a new rails6 application, and I need to host multiple Reactjs applications inside of this rails app.
So I will have an 'admin' section that will be React based.
On the customer facing website it will be regular rails erb/html templates, but I have one area that needs to be react.
How can I have multiple Reactjs applications that can also share components between each other?
How can I have multiple Reactjs applications that can also share
components between each other?
You can use the package Bit which lets you share components between your projects.
Quote from docs:
Bit makes it easy to share and manage components between projects and
apps at any scale.
It lets you reuse individual components across projects.
See documentation, and GitHub repo for details.
There are few ways todo this, personally I use this one.
My current ongoing project also, front-end based on erb and admin panel using ReactJS.
if your app not supporting webpack, then suggesting to install it.
1) install gem 'webpacker'
Also update coffee-rails, for rails6. gem 'coffee-rails', '~> 5.0.0'
2) bundle install
3) bundle exec rails webpacker:install
4) bundle exec rails webpacker:install:react
Viola: Webpacker now supports react.js 🎉
Once after installation, you will see app/javascript/packs/application.js & hello_react.jsx
Create routes and controllers as usually, just make sure to create and use specific layout under app/views/layouts/admin.html.erb
# sample - controllers
class AdminController < ApplicationController
layout 'admin'
end
class SampleController < AdminController
def index
end
end
# create routes for this action!
# view/layouts/admin.html.erb
<head>
<%= javascript_pack_tag 'application' %>
</head>
After all, check browser console it will be logged Hello World from Webpacker
from app/javascript/packs/application.js
Everything else as default npm installations and etc.
To start the rails server with webpack
rails s & ./bin/webpack-dev-server

RuntimeError in Home#index

I am new for Ruby on rails. I have configured the rails in my system(Windows 7).
After Creating the new project in rails (localhost:3000) is working fine.
I am try to import the bootstrap in my rails project .
Kindly advise me how to resolve this case.
C:\row\dev\mybootstrap>rails g controller home index
C:\row\dev\mybootstrap>rails s
Its showing the below error.
Go to http://nodejs.org/download/ and install nodejs
Note: Don't forget to restart the machine once nodejs is installed.
what about installing node js?
get it from here https://nodejs.org/en/download

Spree Commerce is working, but no assets.

I'm trying to customize and modify Spree Commerce, but none of the standard asset files/images/views are available under either app/views, lib/assets, or anywhere else I can think to look. I'm trying to go through their tutorials, but I can't find anything to edit. Is there another command I need to decompress everything or something? Thank you so much for any help!
The way I over came this is to download the main spree gem, via github.com, look where the images are located then creating the images I wanted to override in my local app/assets directory with the same path run:
rake assets:precompile:nondigest
restart webrick/pow or any other web server you are running and voila!
I'm guessing you're not really familiar with how gems work. As people here have said, these are not going to automatically show up in your core app directory, but the gemfile and running bundle install knows how to reference them.
So you need to find those gems to figure out the file names, as you said. If you want to view the gemfiles run this command in the terminal:
$ bundle open spree_frontend
If you get this error:
To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR
then you haven't set up the editor, so do this:
export BUNDLER_EDITOR=sublime
Then redo the bundle open command. This should open the spree_frontend directory which will let you investigate the file names/paths and the assets. If you want to change an entire template, you need to create that file matching its name and path exactly as it is in the spree gem (spree/layouts/spree_application.html.erb for example) then when you edit it your rails app will render the code in your core app directory thus overriding the spree gem.
That make sense?

Unable to generate rails footnote

I am trying to install debug tool called rails-footnotes on Rails 3.0 following instruction on GitHub. A check running bundle show rails-footnotes show that I got rails-footnotes-3.7.4 installed. However, when I run
rails generate rails_footnotese:install
>>Could not find generator rails_footnotese:install.
I hope someone experienced the same issue might help me out.
Thank you.
Version 3.7.4 doesn't use a generator, only the newer 3.7.5 (which hasn't been released yet) does. Also, the README has a typo; it should be rails_footnotes:install, not rails_footnotese:install (there is already a pull request to fix this).
If you want to stay on the stable 3.7.4, all the generator command does is add the config/initializers/rails_footnotes.rb file with the same content from the README:
if defined?(Footnotes) && Rails.env.development?
Footnotes.run! # first of all
# ... other init code
end
and a .rails_footnotes file with this:
#this code temporarily disables notes for all controllers
# Footnotes::Filter.notes = []
Otherwise, use the git version to make the generator work:
gem 'rails-footnotes', :git => "git://github.com/josevalim/rails-footnotes.git"

Resources