Ruby on Rails Tutorial | Building a Checklist

Поделиться
HTML-код
  • Опубликовано: 6 ноя 2024

Комментарии • 61

  • @jaepark75
    @jaepark75 6 лет назад +3

    Ryan, I know its been 2 years since you made this but I learning so much from this. Please keep doing more Rails projects!!

  • @nesuburak
    @nesuburak 4 года назад

    thank you very much from Morocco I learned the basics of RoR from you

  • @dominicshib3276
    @dominicshib3276 3 года назад

    I'm 45 mins in and this still works on Rails 6 in 2021!

  • @xxleben85
    @xxleben85 5 лет назад

    dude this is the best tutorial of rails yet

  • @jemilionautoch
    @jemilionautoch 9 лет назад

    Hi, I am from Chile and like all your tutorials.

    • @IHemrick
      @IHemrick  9 лет назад

      ***** Thank you man! That means a lot!

  • @pavlin1
    @pavlin1 8 лет назад

    Great tutorial! As somebody who is just starting out with ruby and ror, this is very helpful!

  • @pcleung6339
    @pcleung6339 8 лет назад +1

    thanks, I learnt Devise, bootstrap and simple_form

  • @IHemrick
    @IHemrick  9 лет назад +3

    Hi everyone! Sorry for the inactivity over the past few months... I am currently working on my next tutorial as I write this. I am going to be building a little Star Wars app with Express.js. Can't wait to start posting more content :D

    • @vikingtyty
      @vikingtyty 8 лет назад +2

      +Ryan Hemrick I need more rails content! Although the express.js stuff is cool too. Your tutorials are the best. :)

    • @pacesferry
      @pacesferry 8 лет назад +1

      +Nick Taylor Yeah man, more Rails content :) +Ryan Hemrick

    • @AliReza-tf5hl
      @AliReza-tf5hl 8 лет назад

      Excellent one I've checking over. Hoping for new Rails tutorial. Thanks.

  • @dmoitim
    @dmoitim 8 лет назад

    As we say here in Brazil, "You're the guy".
    Thanks for share knowledge!
    See ya.

  • @tomjohnston5141
    @tomjohnston5141 6 лет назад

    Thanks for this one, Ryan. I learned a lot. Cheers.

  • @imransyed737
    @imransyed737 6 лет назад

    Great job its working sir Thank you so much for sharing this

  • @luispato9335
    @luispato9335 8 лет назад

    veyr nice. you should make some more Rails tutorials, this video was really nice! =)

  • @jaimeg.8855
    @jaimeg.8855 8 лет назад

    great stuff. i think its great you took the time to style the checklist. Quick question. How could we style the forms focus state to get rid of that hideous yellow? Also how did you know to use user_signed_in? or current_user.present? etc. in the if statements? Thanks a bunch for making these videos. And I especially enjoy how you provide such detailed explanations from start to finish. It helps. And again, great stuff!

  • @tokyodream1819
    @tokyodream1819 3 года назад +1

    Hello and thank you for your brilliant tutorial!
    I have a question, why in path 'layouts/static_landing_page' we use 'static_landing_page' but to the name of the actual file we need to add underline before _static?

  • @supbrotv
    @supbrotv 9 лет назад +7

    One more thing, if you go to localhost:3000/items/id(replace id with the number of the item) you can view other users items. And if you go to localhost:3000/items/id/edit you can edit other users items. So to prevent other users from seeing other users items you can create a private method on your items controller like this
    def own_item
    unless current_user == @item.user
    flash[:alert] = "You cannot view this item."
    redirect_to root_path
    end
    end
    And below the before action add another before action like this -
    before_action :own_item, only: [:show, :edit, :update, :destroy]
    This will prevent users from accessing each others items.

    • @IHemrick
      @IHemrick  9 лет назад

      +supbrotv Great catch! Thank youu!

    • @LiaAdzumi
      @LiaAdzumi 7 лет назад

      I wish I could understand about the comment posted by supbrotv. Due to it, please create additional video regarding the comment posted by supbrotv. Thanks.

    • @TKPhotog
      @TKPhotog 6 лет назад

      Another solution would be to add the following to the beginning of the items_controller.rb file:
      before_action :authenticate_user!

    • @Mr.Plutonium
      @Mr.Plutonium 5 лет назад

      @@LiaAdzumi When you login you can literally edit other user's todo's list. You should only be able to edit YOUR OWN todo list. Therefore you need a method in the items controller that makes sure you could only edit YOUR OWN items.

  • @Stephane_
    @Stephane_ 7 лет назад

    Awesome tutorial! You explained some points that some others tutorials don't explain, thanks. Now I would like to undo the "complete" action. Where can I start?

  • @gmtz
    @gmtz 9 лет назад

    Nice work.

    • @IHemrick
      @IHemrick  9 лет назад

      Gabriel Martinez Thank you!

  • @samofalovaleksey3361
    @samofalovaleksey3361 8 лет назад

    Cool! Thanks!

  • @shulmusicomnibus
    @shulmusicomnibus 8 лет назад +1

    Why do only the GET methods get prefixes like edit_item_path? Why is there no destroy_item_path?

  • @R3JKO
    @R3JKO 8 лет назад

    +Ryan Hemrick please help. I followed your tutorial but at the end I can only show and edit items that are marked as completed but not the new items? :(

  • @HasanTezcan
    @HasanTezcan 5 лет назад +1

    Hello guys I just finish this tutorial; I have a sugestion about complete method
    def complete
    @item = Item.find(params[:id])
    if @item.completed_at == nil
    @item.update_attribute(:completed_at, Time.now)
    else
    @item.update_attribute(:completed_at, nil)
    end
    redirect_to root_path
    end
    if you will change the complete methods with this. You can change the to do situation uncoplete and complete with on click.

  • @eltee704
    @eltee704 7 лет назад +1

    for some reason the delete 29:32 isn't working it just refreshes the item and won't give me the warning message. i've retyped it load of times just incase. the rake routes is working. and edit/update etc. works fine.
    any ideas?

    • @IoannisChatzimanolis
      @IoannisChatzimanolis 7 лет назад

      same here, and also functionality of Mark Complete does not have a route...this is a mixup of links used for these actions. Trying to find out what is happening as we speak. Did you come up with a solution for your problem?

  • @adamkenton2585
    @adamkenton2585 9 лет назад +1

    Hey, Ryan I get this error message:
    Sass::SyntaxError in Items#index

  • @supbrotv
    @supbrotv 9 лет назад

    Hello ryan, what is the difference between current_user.present? and user_signed_in?. I swapped current_user.present? and user_signed_in? and it didnt seem to make any difference. Can you explain this please.

    • @IHemrick
      @IHemrick  9 лет назад

      +supbrotv Hi! Sorry for the late response, but ' user_signed_in? ' is a helper that is built into devise (the gem we used for authentication) and ' .present? ' is something that is in the base Ruby language. I am not sure if .present? would work in this case because I haven't tried it :D

  • @blackholygun
    @blackholygun 8 лет назад

    +Ryan Hemrick, When making the the index.html.erb View file, Ruby gives an error instead of an Black Page:
    Sass::SyntaxError in Items#index
    Showing /Users/.../Ruby/Checklist/app/views/layouts/application.html.erb where line #5 raised:
    File to import not found or unreadable: bootstrap-sprockets.
    Load paths:
    /.../Ruby/Checklist/app/assets/images
    /.../Ruby/Checklist/app/assets/javascripts
    /.../Ruby/Checklist/app/assets/stylesheets
    /.../Checklist/vendor/assets/javascripts
    /.../Checklist/vendor/assets/stylesheets
    /Library/Ruby/Gems/2.0.0/gems/turbolinks-2.5.3/lib/assets/javascripts
    /Library/Ruby/Gems/2.0.0/gems/jquery-rails-4.1.1/vendor/assets/javascripts
    /Library/Ruby/Gems/2.0.0/gems/coffee-rails-4.1.1/lib/assets/javascripts
    Extracted source (around line #17):
    */
    @import "bootstrap-sprockets";
    @import "bootstrap";

    • @DevRightms
      @DevRightms 8 лет назад

      +Dax Rahusen i also had this problem but what i did i reset my app and tried again to put this line and it worked

    • @DevRightms
      @DevRightms 8 лет назад

      restart server

  • @gerardoco2
    @gerardoco2 9 лет назад

    can you please help me understand what this line do in the css : .item:nth-child(n+1){
    padding-top: 1.5em;
    }

    • @IHemrick
      @IHemrick  9 лет назад

      +Gerardo J. Colina Q. Hi Gerardo! The CSS generates a padding-top for the entire checklist item. The nth-child(n+1) is used so that the first checklist item does not have that padding. The .item class is a wrapper for the item title, description, timestamp, and icons. Hope this helps :D

    • @gerardoco2
      @gerardoco2 9 лет назад

      Thanks for your help Ryan , can I have your email to send you a screenshot of the project?
      Thanks for uploading these videos.

  • @juliomejia9824
    @juliomejia9824 8 лет назад

    You are the Papu de los Papus

  • @xinkeli3648
    @xinkeli3648 9 лет назад

    Ryan, may I ask what resources did u use to learn Ruby on Rails?

    • @IHemrick
      @IHemrick  9 лет назад +4

      +Xinke Li Hi Xinke! To learn the basics of Ruby on Rails I mainly used Michael Hartl's Ruby on Rails free tutorial. He walks through the ins-and-outs of the framework and walks through the process of building various applications. After reading through that, I just forced myself to jump in and make an app. Google and Stack Overflow are your best friends when starting out. Don't feel like you need to know everything before starting your first basic app. You will learn more by trying new things!

    • @DevRightms
      @DevRightms 8 лет назад

      +Ryan Hemrick agree :)

  • @IoannisChatzimanolis
    @IoannisChatzimanolis 7 лет назад

    devise_scope :user do
    get '/users/sign_out' => 'devise/sessions#destroy'
    end
    add the above to the Routes.rb file when Sign Out results to error

    • @dougmalones8702
      @dougmalones8702 7 лет назад

      hey Chatz, just wondering if you did ever find a solution for the deleting issue?. i am having the same problem, everytime i try to delete the item, it just refreshes the page instead.

  • @georgejames3868
    @georgejames3868 9 лет назад

    Clicking on the complete button for the second time makes the time reset.. the url_path should be removed from completed items, to ensure no re-submitting

    • @IHemrick
      @IHemrick  9 лет назад

      +George James Thank you George! This was one of my first applications that I built, sorry for not catching that one!

    • @georgejames3868
      @georgejames3868 9 лет назад

      Ryan Hemrick First app?! wow! that is cool... its great

  • @budimulyanto7997
    @budimulyanto7997 9 лет назад

    Hello..
    Great tutorial!!
    I am following this great tutorial but unfortunately, the delete function does not work.
    this is the code related to delete function. could you take a look?
    in show.html.erb
    in items controller
    def destroy
    @item.destroy
    redirect_to root_path
    end

  • @Eitrii
    @Eitrii 7 лет назад

    Anyone know the theme used for sublime?

    • @drinkingineasterneurope6947
      @drinkingineasterneurope6947 7 лет назад

      i think this is atom not sublime

    • @Eitrii
      @Eitrii 7 лет назад

      2:55. Repo for the theme if anyone's interested github.com/itsthatguy/theme-itg-flat

    • @drinkingineasterneurope6947
      @drinkingineasterneurope6947 7 лет назад

      Sorry. it looked as atom to me

    • @Eitrii
      @Eitrii 7 лет назад

      Dimitar Dimitrov no worries it does look like an atom theme.

  • @adante407
    @adante407 6 лет назад

    Please Sir, Can I have some more?

  • @adammaysz4837
    @adammaysz4837 8 лет назад

    canu u make tutorial for absolutly beginners ?

    • @khunemz
      @khunemz 8 лет назад

      +Adam Małysz This is 'rails g scaffold item title:string description:text' from scratch , it is worth to learn for beginner

  • @ShadabKhan-wy2tm
    @ShadabKhan-wy2tm Год назад

    bro i stuck on link_to "sign out" there is error....and routes didn't find....help me