Jay Killeen

Joined

4,030 Experience
25 Lessons Completed
0 Questions Solved

Activity

from the command line `rake secret` and copy into your secrets.yml file for develop and test environments (if you are choosing to gitignore the new file).

Just on the gitignore for secrets.yml. You can't do this after you have already commit secrets.yml. I followed the instructions but had already commited it so gitignore would always see it even if I deleted it etc.

The answer I am now looking for is how to generate a new secrets.yml secret_key_base

Posted in Forum Series Part 6: Search with Ransack Discussion

Just implemented this in conjunction with Ryan's episode 370 http://railscasts.com/episo.... Have some really cool advanced search features now working on my customer index page.

Now just need to figure out how to rspec this stuff (I find BDD doesn't work in the learning phase).

Posted in Tracking Rails App Usage with Analytics

Hi

I notice this site uses Google Analytics to track usage. Is that the standard when it comes to tracking your rails apps? I know it is generally pretty standard in the case of my websites but for Rails Apps I was thinking it would be cool to have the analytics cooked into the app itself so there isn't a requirement to login to a third party or reduce the risk of having corporate IT ask questions about where our data is being sent to.

I have looked at gems such as Redis Analytics https://github.com/saturnine/redis_analytics which seem interesting (although I do not really understand Redis yet).

Does anyone else have any suggestions on how we can track usage in our apps? I just want things like page views, time on site etc so that when I have my app out in the wild I can report back to management how much the teams are using it so I can put business cases through for further development.

My app is using devise and I have all the controllers locked down for authentication. My only metric at this stage is a count of how many times a user has logged in which is an out of the box devise feature.

Any thoughts would be welcome.

Posted in User Authentication with Devise | GoRails

Here is a link to the forum post where I shared links to my Gist code to Bootstrap the Devise views.

https://gorails.com/forum/b...

Posted in Bootstrap Devise User create, edit and sessions new

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?).

Posted in Bootstrap Devise User create, edit and sessions new

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

Posted in User Authentication with Devise | GoRails

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.

Posted in Refactoring Controller Methods Discussion

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 :)

Posted in User Authentication with Devise | GoRails

What video did you create the navbar partial?

Posted in User Authentication with Devise | GoRails

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?

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.