Posts

Showing posts from November, 2021

Very Good link for different ruby on rails questions

https://www.gkmit.co/blog/web-app-development/how-to-interview-your-ruby-on-rails-developer 

How to Drop table in rails

    Step 01 :::  Run the below command  :: This will create new migration file  rails generate migration drop_tablename   Step 02 :::  Add these below two methods in that migration def up drop_table :products end def down raise ActiveRecord::IrreversibleMigration end Step 03 ::: rake db:migrate  This will drop the Table.

Active Admin

 Send by the Trainer ::  https://activeadmin.info/documentation.html

Instagram Clone Application in Ruby on Rails

 https://medium.com/lightthefuse/building-an-instagram-clone-with-ruby-on-rails-part-1-f6f5a52882bd

Note ::::: For a Particular Blog

 By R Sir :: For a Particular Blog ::: Also Check the Creating Time of the Blog :: If this is of recent time then it is very good. Also Check the Gem that we are using in that particular Blog. Every Gem at official doc at github we should follow that official definately

Queries in Rails

Note :: Different Queries we have for different tasks in Rails :: So if you remembers that queries at one place written then it will be benifitted for Us ::

Polls application Good and Nice Application Link

Best Link :: https://www.sitepoint.com/polling-users-rails/ Good Link :: https://code.tutsplus.com/courses/build-a-polling-application-with-rails/lessons/creating-polls

How to Set post between two consecutive dates n ruby on rails

Task :: How to Set post between two consecutive dates n ruby on rails Query at Google  :::: How to find out or extract data by Time.now :: In Between Start_date and end_date  1. Client.where(created_at: (Time.now.midnight - 1.day)..Time.now.midnight) https://www.codegrepper.com/code-examples/whatever/rails+query+between+two+dates 2.  https://blog.revathskumar.com/2012/11/ruby-generate-date-range.html 3. https://blog.revathskumar.com/2012/11/ruby-generate-date-range.html Solution Given by R :: Post.where('starts_at' > ?'  DateTime.now) Post.where('starts_at' > ?' DateTime.now+1.day) ?  :: I think this ? show the Between  starts_at ::: Is the column in any project  DateTime.now ::: It is the paradigm of the Rails

All Ruby on Rails and Ruby Books :: You can Directly Downloads from Here

 https://theswissbay.ch/pdf/Gentoomen%20Library/Programming/Ruby/

robot

home  '11 Nov'   16 another_solution_of_Robot_toy_app 'PErfect Solutions ******' robot_at_11_bov robottest  :: First Wala hai  11 Nov/Robot/robot_at_11nov/robot_at_11_nov$  :: Not  /11 Nov/Cloned Repositories/robot/robot_at_11_bov :: Not  Note :: /11 Nov/Robot_Sudoku/robot_at_11nov/robot_at_11_nov$  In this  if i tough PLACE and LAST Command Then Error otherwise give the correct answer always in each and every condition

data is not passed in rails first time with the lib folder

 1. self method 2. try with services 3. try with model 4. use this command ::  sudo apt-get install build-essential and remove  need to remove  /usr/local/bin/make  also    Link ::  https://stackoverflow.com/questions/58804432/undefined-local-variable-or-method-make-for-mainobject-nameerror 5. checking this :: Autoloading and Reloading Constants (Zeitwerk Mode) https://guides.rubyonrails.org/autoloading_and_reloading_constants.html try it  A :::       config.autoloader = :classic Everytime Error config . add_autoload_paths_to_load_path = false User this method in log folder make the files in the log folder

very nice links of ruby on rails

 https://api.rubyonrails.org/classes/String.html

Top 10 Ruby on Rails Blog

 Ruby on Rails Nice Blogs from Internet :: 1.   https://weblog.rubyonrails.org/  Very Nice Blog for each and every update for ruby on Rails. 2. 

cloned repositories

For Sudoku ::   https://github.com/dwijendraparashartech/sudokutest.git For Robot ::     https://github.com/dwijendraparashartech/robot_at_11_bov.git

How to give root Route in Ruby on Rails :: There are three ways

  root "application#index" root to: "application#index" get "/", "application#index"

Error in the Builder Project :: Robot Rails

Note :  The model name and Project name should not be same .It can give the error (many Errors)- Main error is undefined method for nil class ::for example new data

Role of Services in the Rails Application

Rinku Sir Guide and Also the Internet Tells at 11 nov  Role of Services in the Rails Application Error :: In the Rails Sudoku Project. Solution :: Jo sudoku.rb file generate kiya hai lib folder mein usko robot.rb mein hi karo. Link :: https://www.google.co.in/search?q=what+is+the+role+of+services+in+rails+applications&sxsrf=AOaemvJ6ffaSg65m45L4FdcMXbTsKC6fzQ%3A1636613822867&source=hp&ei=vr6MYZjiMuzW5OUPreKX8Aw&iflsig=ALs-wAMAAAAAYYzMztdtC8WjfAH3SQf0ypzAy7QuhESb&oq=what+is+the+role+of+services+in+rails+applications&gs_lcp=Cgdnd3Mtd2l6EAMyBQghEKABOgUIABCRAjoLCAAQgAQQsQMQgwE6CAgAEIAEELEDOgUIABCABDoICC4QgAQQsQM6DgguEIAEELEDEMcBENEDOgUILhCABDoKCAAQgAQQRhD_AToHCCMQ6gIQJzoECCMQJzoLCC4QgAQQsQMQgwE6CAgAELEDEIMBOgsIABCABBCxAxDJAzoGCAAQFhAeOggIIRAWEB0QHjoHCCEQChCgAUoFCDwSATRQAFi2hwFgy4gBaAVwAHgBgAGMAogBkUSSAQYwLjQ5LjaYAQCgAQGwAQo&sclient=gws-wiz&ved=0ahUKEwiYua3M3Y_0AhVsK7kGHS3xBc4Q4dUDCAc&uact=5

Error ::: The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource. (Errno::ENOSPC)

Error :::  The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource. (Errno::ENOSPC) Server was not started  Link ::  https://stackoverflow.com/questions/47075661/error-user-limit-of-inotify-watches-reached-extreact-build Solution ::    echo fs.inotify.max_user_watches= 524288 | sudo tee /etc/sysctl.d/ 40 - max -user-watches.conf && sudo sysctl --system

Repeat Keys Problem in LAptop

Settings Universal Access Typing Repeat Keys

null values in the arrray in taking by the postman or the rest client

  sabse jyada jaroori hai ki tum search kya kiya  pass null in array + rby Link ::  https://stackoverflow.com/questions/47092542/sending-array-of-nulls-in-json-request-rails-5/47094180 In application.rb add below line config.action_dispatch.perform_deep_munge = false Now the values of null is taking by the rails as input and it is showing the input and output to both the places. For more info https://apidock.com/rails/v3.2.8/ActionDispatch/Request/deep_munge https://til.hashrocket.com/posts/e1bed09363-deepmunge-i-hardly-knew-ye

Error

 params [:data] *** ArgumentError Exception: wrong number of arguments (given 1, expected 0) Error Soultion :: when we give params[:data] then this error comes due to the space between params and [:data]

null Value problem solve in the builder sudoku project

First Method I Used ::   json .toString() Response ::  After this I get Error Second Method  I Used ::   {"data": [ [ [2, null, 5],  [null,  null, 9],  [null, null, 4] ], [  [null,  null, null], [null,  null,  null], [3,  null, 7] ], [ [7,  null, null], [8, 5, 6],  [null, 1,  null] ], [ [4, 5, null],[ 7,  null, null],   [null, null,  null] ], [  [null, null, 9],  [null, null,  null], [1, null, null] ], [  [null, null, null], [null, null, 2], [null, 8, 5]] ], [  [null, 2,  null], [4, 1, 8],  [null,  null, 6] ], [ [6, null, 8], [null,  null,  null],  [null,  null, null] ], [ [1, null,  null], [2, null,  null], [7,  null, 8] ] ] } Response ::  After this I get Error Third Method I Used ::   {"data": [ [2, "null", 5,  "null",  "null", 9,  "null", "null", 4], [ "null"...

Very good example of sudoku puzzzle in rails just similiar to the main example we have test at the builder

 https://medium.com/isian-blog/solving-sudoku-with-ruby-82ad6d82263d

Replace null values with zero values in ruby on rauls '

nil.to_i => 0 nil.to_f => 0.0 .......... => [] irb(main):002:0> value = array[0] || 0 => 0 irb(main):003:0> value => 0 Hope this helps, ......... use :null => false change_column :my_table , :my_column , :integer , :default => 0 , :null => false      null to no effects change_column will not query to replace the null values when you change null to false, even if you have a default set. This may cause the query to fail (may depend on the database used). change_column_null will optionally take a value to replace nulls if you are setting null to false. If you want to set a default and disallow nulls you likely can’t do both in one change_column call. to set NULL => NO use :null => false change_column :my_table , :my_column , :integer , :default => 0 , :null => false https://refactoring.guru/introduce-null-object Why Refactor Dozens of checks for null make your code lo...

Replace null values witht he zero values in ruby on rails

https://www.generacodice.com/en/articolo/4309582/rails-3-2-replace-null-values-with-empty-string-from-json-serialization 

again next solution of the sudioku

 https://codereview.stackexchange.com/questions/164100/validate-if-sudoku-is-correct

Tools for the Project Assesment ::

  Tools for the Project Assesment :: trello jira asana pivotal tracker

how to run the rails application without model

 https://dana-scheider.medium.com/creating-a-rails-5-api-without-models-d50cd5d15c97 how to run the rails application without model 

Sudoku application final result

 sudoku_test.rb   at the 0      

Sudoku Applications Links :: All of the Solutions Link

Link 0 :::: https://medium.com/isian-blog/solving-sudoku-with-ruby-82ad6d82263d (Full Project Self Made First Project not given but made by self writing the code) Link 1 :::: https://gist.github.com/dsasse07/f95b7c3380b14660b85c6ac2780e1b9d Link 2 :::: Link 3 :::: https://snipplr.com/view/1226/ruby-sudoku-solver Link 4 :::: http://rubyquiz.com/quiz43.html Link 5 :::: http://rubyquiz.com/quiz43.html Link 6 :::: https://topic.alibabacloud.com/a/ruby-solves-the-sudoku- problem_1_32_32387609.html Link 7 :::: https://www.artima.com/forums/flat.jsp?forum=123&thread=148279 Link 8 ::::   https://blog.cloudboost.io/sudoku-solver-ruby-recursive-implementation-backtracking-    technique-b69582427353 Link 9 :::: Link 10 :::: Links :: https://github.com/nadavmatalon/sudoku (Full Project in Laptop :: Zip File) Link 11 :::: Links :: https://github.com/rockychiang/sudoku_app (Full Project in Laptop :: Zip File) Link 1 2 :::: Links ::  https://dev.to...