Skip to content

Instantly share code, notes, and snippets.

View prasanthchaduvula's full-sized avatar

Prasanth Chaduvula prasanthchaduvula

View GitHub Profile
@prasanthchaduvula
prasanthchaduvula / authentication.rb
Last active April 22, 2025 14:28
Overview of files generated by the Rails Authentication Generator
#app/controllers/concerns/authentication.rb
module Authentication
extend ActiveSupport::Concern
included do
before_action :require_authentication
helper_method :authenticated?
end
@prasanthchaduvula
prasanthchaduvula / App.js
Created March 1, 2023 05:40
Without custom hook
import React, { useEffect, useState } from "react";
import Followers from "./Followers";
export default function App() {
const [isLoading, setIsLoading] = useState(true);
const [user, setUser] = useState(null);
const [activeUserIndex, setActiveUserIndex] = useState(0);
const users = ["prasanthchaduvula", "vipulnsward", "getify"];
useEffect(() => {

Tables

create users table

class CreateUsers < ActiveRecord::Migration[6.0]
    def change
	    create_table :users do |t|
		    t.string :name
		    t.string :phonenumber
		    t.timestamps  

end

@prasanthchaduvula
prasanthchaduvula / Detailed-understanding-of-Rails.md
Created August 18, 2020 17:10
Detailed understanding of Rails and how it works

Detailed understanding of rails. How it works

What is Ruby on Rails

It's most popular server-side web application framework ( written in Ruby ) to build web applications. Build from simple to complex applications, there is no limits to what you can accomplish using Rails!. Ruby on Rails as framework it has collection of code, tools & utilities that give you a specific structure to work with when you’re writing software. Rails makes it much easier and more fun. It's a open source and opinionated software.

Rails philosophy - two major principles

1. DRY - Don't Repeat Yourself means not writing the same information over and over again, so that our code becomes more maintainable, more extensible, and less buggy. 2. Convention Over Configuration - It provides a default way of doing things. It's is opinionated gives you everything you need to create a web application and follows all the best practices. you’ll be more productive & gets things done faster.

A detailed report ROR-Day1-Day3

  1. First day I read 6 chapters of Michael Hartl ruby on rails book (except 1st chapter) and coded smaple_app along with it
  2. Second day I watched 30 lessons and coded eventz app along with it
  3. Today (3rd day) I watched remaining videos and completed the eventz app
  4. I want to go through active storage implementation once again and want to use amazon S3 as suggested in the video
  5. I learnt new patterns and the approach is beginner friendly
  6. The best part of rails is it's conventions, everything comes handy but at the same it's not easy to remember those conventions by doing it one time
  7. Needed more practice and I know the upcoming challnges or tasks make it more easy with rails conventions

A detailed report Day5-Day12

  1. After doing grocery-store-challnge on day4 I started reading 99 bottles of OOP (Beer version in Ruby)
  2. When I was in first chaper - I took some time to understand the code first pattern of song. As first time I came to know about 99 bottles song lyrics.
  3. Once I got it and read the first chapter and practiced the four different patterns (Incomprehensibly Concise, Speculatively General, Concretely Abstract, Shameless Green)
  4. I got so much confident and at the core of the heart I was very happy as I came to know about four ways to solve the same problem
  5. I took five days to complete the book and practice the code
  6. I loved the book because it changed - the way of my thinking towards a problem
  7. Refactoring is never ending process - but it makes code better
  8. As it's said in challange - I solved grocery-store using oop.

A detailed report Day1-Day3

  1. In these last two days I completed the RubyMonk primer and ascent
  2. After reading all documentation I understood the concept
  3. Yesterday I was confused about I/O and serializing topics and few more topics i was unconfident
  4. So today morning I decided to solve the grocery store challnge to gain confidence
  5. And I solved and published the repo and shared it thorught the google form
  6. I got self confidence and revised RubyMonk primer and ascent once again got cleared up the things
  7. Need to revise metaclasses
  8. Finally topics are clear and needed to solve more problems to gain confidence