TILs - Fueling Curiosity, One Insight at a Time

At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.

Published
Author
user-image
Sujay

Code

Add the `:environment` task as dependency for Rake task to access models.

desc "count number of users"
task :count_users do
  puts User. count # NameError: uninitialized constant User (NameError)
end

To make the models available, tell Rails to load the environment before running the task.
desc "count number of users"
task count_users: [:environment] do
  puts User. count
end

Published
Author
user-image
Rishav Raj
System Analyst
How to enable web view to inspect website which is open on iphone

1. you have to first go to your iphone setting and search for the safari then then you got the advance option click on that then you got the web inspector enable that option.
2. now connect your iphone with your mac and now open the safari browser in the mac
3. Now click on safari option in the mac then click on preferences and go to Advance option and enable the show develop menu on menu bar now you have the develop option on you mac safari menu bar.
4. Now click on the develop option and you get your iphone option and now you will able to inspect your website which is open in your iphone
This is helpful to resolved bug which is only happen on iphones
Published
Author
user-image
Syed Sibtain
System Analyst
HIGH LEVEL DESIGN
It is simply a blueprint for the system. In other words, a generic system design that describes the overall architecture and design of a system.
1. System - is a set of components put together to build a product/feature.
2. Feature - is a set of requirement to be satisfied.
System Design is necessary to ensure that a system meets specific requirements, such as performance, reliability, scalability, and maintainability.
Without a clear blueprint, a system may not work as intended, leading to performance issues in the future, downtime, etc.

High-level design also includes:
1. Overall Architecture.
2. Database design
3. Main Components
4. Services and platforms
Published
Author
user-image
Soniya Rayabagi
How we can change the default Sqlite database to Postgresql database in Ruby on Rails ,
• Make sure homebrew is installed .
• Install Postgresql , brew install postgresql
• Start the postgresql , brew services start postgresql
• Make changes to postgresql database in the database.yml file
• Add rails db:seed to ensure your data gets reset and is visible on the browser .
Published
Author
user-image
Soniya Rayabagi
The underscore ( _ ) in Rails ,
simply gives you the return value of the last evaluation made in the console.
irb(main):015> movie.title
=> "Avengers: Endgame"
irb(main):016> _
=> "Avengers: Endgame"
Published
Author
user-image
Nisanth
AWS (KMS ) Key Managament Service

We are using Key Management Service to encrypt sensitive data stored in an S3 bucket, you can use KMS to create a key, and then configure the S3 bucket to use that key for encryption. This way, only authorized users with the right permissions can access and decrypt the data.
Published
Author
user-image
Nisanth
AWS (KMS ) Key Managament Service

We are using Key Management Service to encrypt sensitive data stored in an S3 bucket, you can use KMS to create a key, and then configure the S3 bucket to use that key for encryption. This way, only authorized users with the right permissions can access and decrypt the data.
Published
Author
user-image
Soniya Rayabagi
ParameterMissing we can resolve error , param is missing or the value is empty this indicates that we should give the proper name value to params which is same assign to our model .
Published
Author
user-image
Soniya Rayabagi
Routes - Linking Pages where we can ,
Link to Index Page: Use the link_to helper in the view to create a link that navigates to the index page, displaying a list of items.
Link Index Page to Show Page: Utilize the link_to helper in the index page to link each item to its respective show page, allowing users to view detailed information about each item.
Add a Root Route: To replace the default Rails welcome page , with usually the page that shows a list of items or the index page by defining a root route in the routes file.
Published
Author
user-image
Soniya Rayabagi
To add the image or logo which are inside app/assets/images we need not to copy the path , we can just copy the name of an image 'logo.png' and put inside the image_tag <%= image_tag("logo.png") %> when you run the server the logo will be visible on the browser .

Showing 39 to 41 of 82 results

Ready to Build Something Amazing?

Codemancers can bring your vision to life and help you achieve your goals