Posts

SMTP Credentials

11.SMTP Credentials :  its use for get password by mailer app/config/ envernments/ development.rb development.rb config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: 'smtp.gmail.com', port: 587, domain: 'localhost', user_name: 'testing.bittern@gmail.com', password: 'bittern1234', authentication: 'plain', enable_starttls_auto: true }

Bootstrap-form-validation

http://twitterbootstrap.org/bootstrap-form-validation http://twitterbootstrap.org/

Adding a column to an existing table in a Rails migration

Use this command at rails console rails generate migration add_fieldname_to_tablename fieldname : string and rake db : migrate to run this migration

Remove a column with migration:

rails g migration RemoveCountryFromSampleApps country : string This will generate the following migration  in Rails 5.0 : class RemoveCountryFromSampleApps < ActiveRecord :: Migration [ 5.0 ] def change remove_column : sample_apps , : country , : string end end
Deploy Ruby On Rails application on production AWS Ec2 server 1. Give 400 permission to pem file. sudo chmod 400 example.pem 2. Login on server.   ssh -i example.pem file ubuntu@ip_address ---------------------------------------------------------------------- 3. You can check ubuntu server details by: lsb_release -a No LSB modules are available. Distributor ID:    Ubuntu Description:    Ubuntu 16.04.2 LTS Release:    16.04 Codename:    xenial ---------------------------------------------------------------------- 4. Install the required libraries: sudo apt-get update sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs yarn sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev gpg --keyserver h...

dmp file

Dump in Import Postgres:- $ pg_dump -U root blog_development > blog_development.sql Import: $ psql -U root blog_production < blog_development.sql Dump in Import Mysql:- p -U USERNAME DBNAME > db mysqldump -u [username] -p [database name] > [database name].sql exp Dump $ mysqldump -u root -p blog_development > blog_development.sql Import: $ mysql -u root -p blog_production < blog_development.sql Map gem link:- https://www.sitepoint.com/geocoder-display-maps-and-find-places-in-rails/ link :- Getting Started - Instagram API - Documentation - Facebook for Developers Heroku Import db: heroku pg:backups:restore 'https://sisgain.com/project/healthsoul/soul.dump' DATABASE_URL Local server Import db: pg_restore --verbose --clean --no-acl --no-owner -h localhost -U root -d healthworld41_development_local ~/Downloads/pgnew.dump
Bootstrap-form-validation: http://twitterbootstrap.org/bootstrap-form-validation http://twitterbootstrap.org/ http://arvindkushwah9.blogspot.in/ Link timer Clock Set Time: https://codepen.io/SitePoint/pen/MwNPVq User Authentication: Devise gem Link: https://github.com/plataformatec/devise 1. Add devise gem in to Gemfile gem 'devise' 2. Run “bundle install” 3. Next, you need to run the generator: $ rails generate devise:install 4. Add file: Here is a possible configuration for config/environments/development.rb : config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 5. Generate model rails generate devise MODEL MODEL cam be User, Admin, Customer e.t.c 6. Run “rake db:migrate ” 7. Restart server 8. Controller filters and helpers: app/controller/ module controller like articles_controller.rb : before_action :authentic...