Never keep any secret data in public folder. Always use environment variables to keep secret data. Suppose we want to set postgresql username and password as environment variables in Ubuntu then do as, # type the following in the terminal to write in the .bashrc file. echo 'export MY_POSTGRESQL_USERNAME="rajkumar"' >> ~/.bashrc echo 'export MY_POSTGRESQL_PASSWORD="HJH34df@dff#@"' >> ~/.bashrc reload .bashrc as, source ~/.bashrc In order to print environment variables prepend it with $ as, echo $MY_POSTGRESQL_USERNAME echo $MY_POSTGRESQL_PASSWORD test environment variables as, echo $MY_POSTGRESQL_USERNAME rajkumar echo $MY_POSTGRESQL_PASSWORD HJH34df@dff#@ Also use ubuntu command printenv to print all the environment variables. then in the database.yml use these environment variables as, development: adapter: postgresql encoding: unicode host: localhost username: <%= ENV["MY_POSTGRESQL_USERNAME"] %> password: ...
Start with following, routes rake routes readme schema *_id search - for association project structure models lib/* controllers views rails test cases Use rails debuggers tool like pry Use browser dev tools see the flow with logs
Comments
Post a Comment
Let me know for any query..