{"id":16352867,"url":"https://github.com/mixelpixel/crude_blog","last_synced_at":"2025-11-20T12:30:18.351Z","repository":{"id":106835149,"uuid":"81972003","full_name":"mixelpixel/CRUDe_blog","owner":"mixelpixel","description":"Create Read Update Delete edit (CRUDe)","archived":false,"fork":false,"pushed_at":"2017-05-19T01:44:59.000Z","size":2060,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T18:55:33.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mixelpixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-14T17:39:32.000Z","updated_at":"2020-01-29T08:16:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"22c4f57e-d556-4781-927c-fb4a722a6e67","html_url":"https://github.com/mixelpixel/CRUDe_blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FCRUDe_blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FCRUDe_blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FCRUDe_blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FCRUDe_blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mixelpixel","download_url":"https://codeload.github.com/mixelpixel/CRUDe_blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239619465,"owners_count":19669449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T01:27:53.716Z","updated_at":"2025-11-20T12:30:18.308Z","avatar_url":"https://github.com/mixelpixel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C.R.U.D.\nI am following this tutorial:\n1. https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-1  \n2. https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-2  \n...mostly because I wanted to quickly learn how to set up a blog using CKEditor.  \nHaving finished this tutorial, I moved on to:  \n3. http://guides.rubyonrails.org/v4.2/getting_started.html\n\n## My aim is to build a CRUD blog with text editing, hence \"CRUDe\"\n - **C** reate\n - **R** ead\n - **U** pdate\n - **D** estroy\n - **e** dit text with [CKEditor](http://www.rubydoc.info/gems/ckeditor/4.2.0).  \n..some thoughts on [CRUD and REST](https://softwareengineering.stackexchange.com/questions/120716/difference-between-rest-and-crud) (Representational State Transfer)  \n\n### I initialized this git repository locally and got started.\n1. After finishing part one of the tutorial I decided to push the repo to github.\n2. Per: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/\n\n### Ruby and Rails versions, working with macOS Sierra\n```\n$  ruby -v\nruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]\n$  rails -v\nRails 4.2.0\n```\n# [Part One](https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-1)\n\n## [Rails Application](https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-1#toc-rails-application)\n1. `rails new -T`  \n2. `rails g model Post title:string body:text`  \n3. `rake db:migrate`  \n## [Installing Simple Form and Bootstrap-Sass](https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-1#toc-installing-simple-form-and-bootstrap-sass)\n4. Add simple_form and bootstrap gems to Gemfile  \n5. `$ bundle install`  \n6. Set up bootstrap  \n  - add bootstrap requirement to app/assets/javascripts/application.js  \n  - Rename app/assets/stylesheets/application.**css** to  \n           app/assets/stylesheets/application.**scss**\n  - add @imports to Sass (.scss) file.\n7. `rails generate simple_form:install --bootstrap`  \n## [Setting up the Posts Controller and Views](https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-1#toc-setting-up-the-posts-controller-and-views)\n8. `rails g controller Posts`  \n9. Set up controller  \n  - NOTE: There is an error in the code on the tutorial page.  \n    app/controllers/posts_controller.rb should be:\n    ```\n      def create\n        @post = Post.new(post_params)\n        if @post.save # \u003c----- tutorial has (post_params) here\n        ...\n    ```\n  - and:\n    ```\n      def update\n        if ...\n          redirect_to post_path(@post) # \u003c--- singular\n      ...\n    ```\n10. Create /app/views/: \\_form.html.erb, new.html.erb, edit.html.erb, index.html.erb, \u0026 show.html.erb.\n11. Configure /app/config/routes.rb  \n## [Installing   CKEditor](https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-1#toc-installing-ckeditor)\n12. add ckeditor gem  \n13. `bundle install`  \n14. `rails generate ckeditor:install --orm=active_record --backend=carrierwave`  \n15. `rake db:migrate`  \n16. Set up CKEditor\n  - add ckeditor requirement to app/assets/javascripts/application.js  \n  - Create a directory called ckeditor in app/assets/javascripts, then create a new file called config.js\n\nPart 1 fin.\n\n# [Part Two](https://scotch.io/tutorials/build-a-blog-with-ruby-on-rails-part-2 )\n## Enable Authentication Using Devise.\n### Install Devise.\n1. Add Devise gem to your Gemfile: `gem 'devise', '3.5.2'`  \n2. `bundle install`  \n3. `rails g devise:install`  \nAlways read this stuff:  \n```\n$  rails g devise:install\nRunning via Spring preloader in process 18743\nExpected string default value for '--test-framework'; got false (boolean)\nExpected string default value for '--helper'; got true (boolean)\n      create  config/initializers/devise.rb\n      create  config/locales/devise.en.yml\n===============================================================================\n\nSome setup you must do manually if you haven't yet:\n\n  1. Ensure you have defined default url options in your environments files. Here\n     is an example of default_url_options appropriate for a development environment\n     in config/environments/development.rb:                                         # \u003c---- THIS\n                                                                                    # \u003c---- and\n       config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } # \u003c---- THIS\n\n     In production, :host should be set to the actual host of your application.\n\n  2. Ensure you have defined root_url to *something* in your config/routes.rb.      # \u003c---- DONE\n     For example:\n\n       root to: \"home#index\"\n\n  3. Ensure you have flash messages in app/views/layouts/application.html.erb.      # \u003c---- TO DO\n     For example:\n\n       \u003cp class=\"notice\"\u003e\u003c%= notice %\u003e\u003c/p\u003e\n       \u003cp class=\"alert\"\u003e\u003c%= alert %\u003e\u003c/p\u003e\n\n  4. If you are deploying on Heroku with Rails 3.2 only, you may want to set:       # \u003c---- NOPE\n\n       config.assets.initialize_on_precompile = false\n\n     On config/application.rb forcing your application to not access the DB\n     or load models when precompiling your assets.\n\n  5. You can copy Devise views (for customization) to your app by running:          # \u003c---- TO DO\n\n       rails g devise:views\n\n===============================================================================\n```\n### Configure Devise.  \n4. update config/environments/development.rb with  \n  `config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }`  \n5. update app/views/layouts/application.html.erb with  \n```\n    \u003cp class=\"notice\"\u003e\u003c%= notice %\u003e\u003c/p\u003e\n    \u003cp class=\"alert\"\u003e\u003c%= alert %\u003e\u003c/p\u003e\n```\n### Configure Devise Administration.  \n6. `rails g devise Admin`  \n7. `rake db:migrate`\n8. `rails g devise:views admin`  \n9. modify views/admins/registrations/edit.html.erb  \n10. modify views/admins/registrations/new.html.erb  \n11. modify views/admins/sessions/new.html.erb  \n12. modify views/admins/shared/\\_links.html.erb  \n13. Uncomment line 211 of Devise initializer; config/initializers/devise.rb  \n    - change `false` to `true`  \n14. Check out: http://localhost:3000/admins/sign_in  \n### Navigation Bar.  \n15. `touch app/views/layouts/_navigation.html.erb`  \n16. modify: app/views/layouts/application.html.erb  \n17. reload browser to see navigation bar.  \n### Authenticate Action.  \n18. modify app/controllers/posts_controller.rb  \n### Validation.  \n19. modify app/models/post.rb  \n### Admin Actions on Index Page.  \n20. modify app/views/posts/index.html.erb  \n## Enable Image Uploading.\n### Image Uploading for Posts\n21. add carrierwave and mini_magick to Gemfile  \n22. `bundle install`  \n23. `rails g ckeditor:install --orm=active_record --backend=carrierwave`  \n24. `rake db:migrate`  \n  - Now images can be uploaded!  \n### Image Uploading for Admins.\n25. `touch config/initializers/carrier_wave.rb`  \n26. modify config/initializers/carrier_wave.rb  \n27. `rails g uploader Avatar`  \n28. modify app/uploaders/avatar_uploader.rb  \n29. `rails g migration add_avatar_to_admins avatar:string`  \n30. `rake db:migrate`  \n31. modify app/models/admin.rb  \n32. modify app/controllers/application_controller.rb  \n33. modify app/views/admins/registrations/new.html.erb  \n\n....AND, there's still work to be done to get it all functional.  \nThis is some help: https://github.com/kinsomicrote/scotch-blog-2  \nbut not much :\\\\  \nWhat an annoying end to a tutorial.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixelpixel%2Fcrude_blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmixelpixel%2Fcrude_blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixelpixel%2Fcrude_blog/lists"}