Activity
Thanks Chris,
Yeah it is probably pretty basic in the scheme of things but I have stumbled on this a few times when I am going back and building a new app from scratch. Hopefully the code helps other beginners. I'll link to this forum post from my comment on your video too.
Now I have some nice user registration pages that look a bit more like the one's in the video. The only areas I haven't done yet are the devise errors partial and updating passwords etc outside of the edit registration pages. But people should be able to get the gist from my gists' (is that supposed to be the pun?).
Hi All
I had some difficulty following this https://gorails.com/episodes/user-authentication-with-devise - screencast when it came to Bootstrapping devise.
Chris' looked like a bit of extra editing happened behind the scenes. I have since just figured out my own app so here is the code I used...
Had issues with markdown so have published on Gist instead:
Bootstrapping Devise Edit Registration View on Rails 4.2.0 with Bootstrap 3
https://gist.github.com/jaykilleen/42e0b123ef97a36ad18d
Bootstrapping Devise New Registration View on Rails 4.2.0 with Bootstrap 3
https://gist.github.com/jaykilleen/e77cb4fe9dbdf79a2176
Bootstrapping Devise New Session View on Rails 4.2.0 with Bootstrap 3
https://gist.github.com/jaykilleen/599c07f83e86e1391ae5
The form-group class that is added doesn't render my form as Bootstrap at all :( hmm
Posted in Pagination with will_paginate Discussion
If you are a noob like me and it doesn't work try adding ', :per_page => 1' as your controller pagination option.
I was working with seed data with only 10 customers in it so will_paginate was not rendering because the default 30 meant there was no reason to render it at all! I swore I had some bug but turns out it was just that.
I'm a big yes too. Possibly in a way that directs towards some of Sandi's 'guide/rules' that they keep talking about on Ruby Rogues and Giant Robots Smashing Into Other Giant Robots (ie breaking big things into little things, explaining the whole methods sending messages between each other).
Another idea for you would be to have a 'these are the specs to go with an episode'. So when you do a cast on Twitter omniauth login etc we have another cast showing how to test it. From a beginner point of view that's the biggest gap in my knowledge. Everyone says 'test first' but it is hardly ever tackled like that in the teaching methods. I know it could be cumbersome so a seperate episode might work.
Posted in Styling with Bootstrap Sass Discussion
Nailed it! Thank you. Would be interesting to see how we can get that site wide search feature to work :)
What video did you create the navbar partial?
If you are intending to use an authorisation gem such as cancancan or pundit then the the other videos use 'rails generate devise User role'. Save you a couple of clicks going back to see.
Posted in Authorization with Pundit Discussion
Pundit seems to look more like the rest of my app. I do like that in cancancan you can do the can? wrap which looks really sweet and you have the authorize resources in your controllers but once I get into abilities.rb things start to get messy.
Testing with Rspec seems to look quite similar for both after viewing an existing app I have inherited and looked at this article from Thunderbolt Labs http://thunderboltlabs.com/....
This article was also a good read to get the initial purpose for pundit http://www.elabs.se/blog/52....
Posted in Authorization With CanCanCan Discussion
That was really good thank you. I'll take a look at the Pundit one. I am interested in understanding more around the Permission model and storing the abilities in a database. I think at this stage I will build it out in abilities.rb but concerned it may be difficult to migrate to a Permission model later down the track.
Doesn't that get a bit dangerous if the user forwards their email to someone else? We had a scenario where a HR Manager was forwarding an email to people in their team, which then got emailed to people in the business. Before you know it people are logging in as HR Manager and could potentially see salary information etc.
OR
Is this why we expire tokens for the one's sent out on emails etc?