Posts

Showing posts from November, 2020

admin include in the project

  step1 add the role column to user table step2 in user.rb add this method def is_admin? self .role.try(:downcase) === 'admin' end step3: add the admin folder and make controllers in that step4: add the controller path in the admin controllers step5: add the correct naming and code in the application controller in the admin this is very imp step

How to connect your shopify api to rails ;;;; Guidence of PRashant ::: Very Good Doc :: https://medium.com/@ndow_11367/how-to-connect-your-ruby-on-rails-app-to-the-shopify-api-5f4b310c0062

Image
 how to search at google shopify api integration rails For make account at shopify and for generate the A_KEY https://bitterntest.myshopify.com/admin/apps/private/294544507047       ........................................................................................................................................ links First Imp Link ::::::::::::::; Most Important Doc from where we start it  https://medium.com/@ndow_11367/how-to-connect-your-ruby-on-rails-app-to-the-shopify-api-5f4b310c0062 Vedio Link https://www.youtube.com/watch?v=yGxeoAHlQOg Second Imp Link https://github.com/Shopify/shopify_app .............................................................................................................................................................. .............................................................................................................................................................. The Shopify API can be a bit intimidating on fir...

how to remove your present work after commit

all files we have put into stash   git stash --include-untracked and after that we delete it 

apipie in rails rinku sir blog

 https://rinkukushwah679.blogspot.com/search?q=api

queries in the project

 what is the size when we create new product  in online remove the line in status remove the line 

Rails Redirect _to Method : put in the project ecom_app : in Rails Official Projects

https://blog.bigbinary.com/2016/02/29/rails-5-improves-redirect_to_back-with-redirect-back.html In Rails 4.x, for going back to previous page we use  redirect_to :back . However sometimes we get  ActionController::RedirectBackError  exception when  HTTP_REFERER  is not present. class PostsController < ApplicationController def publish post = Post . find params [ :id ] post . publish! redirect_to :back end end This works well when  HTTP_REFERER  is present and it redirects to previous page. Issue comes up when  HTTP_REFERER  is not present and which in turn throws exception. To avoid this exception we can use  rescue  and redirect to root url. class PostsController < ApplicationController rescue_from ActionController :: RedirectBackError , with: :redirect_to_default def publish post = Post . find params [ :id ] post . publish! redirect_to :back end private ...

Heroku Push the Code

   Heroku Push the Code  STEP 0  git remote STEP 1  heroku login STEP 2   git remote -v   STEP 3    heroku website will automatically open and make login at that   STEP 4   make a repository at heroku website    STEP 4   copy the heroku link from the heroku website    STEP 5   run the command at the terminal          heroku git:remote -a ecom-chef-app [{{in the underlined section only app name write not the source url}}]]         ecom-chef-app  ====   app name        STEP 6          heroku run rake db:migrate   STEP 7         heroku run rake db:seed STEP 8 Also make the Commit and add first time git add. always git commit -m''add" git push heroku master                                   ...

heroku and gits commands

 heroku login  heroku website will automatically open and make login at that check git remote check git remote -v heroku run rails c heroku logs -t heroku restart heroku run rake db:create heroku run rake db:seed                ::::::::::::::::; whenever required 

method approved

 first find the route

polpulating the database meaning :: Since the data in the tables is called the population, filling the tables with data is called populating the database.

  Since the data in the tables is called the population, filling the tables with data is called populating the database.                               ......................................................................................................................... As others already wrote, to populate a database means to add data to it. The background of the term is in the foundation of database theory. Fundamentally a database consists of a schema (the logical rules that govern the data, implemented as table structure and constraints) — also called the intention — and the population (facts represented as data in those tables) — also called the extension. Since the data in the tables is called the population, filling the tables with data is called populating the database.

What is Rails Seed Command: rails db:seed

                  ........................................................................................................................            Rails seed  files are a useful way of populating a database with the initial data  needed  for          a  Rails  project. The  Rails  db/ seeds .  rb  file contains plain  Ruby  code and         can be run with the  Rails -default  rails  db: seed  task.           ........................................................................................................................ New:  Ruby on Rails 5.0 version of this book! 4.5. Populating the Database with seeds.rb With the file  db/seeds.rb , the Rails gods have given us a way of feeding default values easily and quickly to a fresh installation. T...