Brittany Hicks

Joined

160 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in How do I submit multiple checked items?

Hey guys!
I think this might be the episode you're looking for...https://gorails.com/episodes/clean-javascript-with-data-behavior
Hope it helps! :)

Posted in Solving FizzBuzz in Ruby Discussion

Gotcha. :) Thanks Chris!

Posted in Solving FizzBuzz in Ruby Discussion

Okay I'm hitting an error and I understand what it's saying but I'm more confused as to why it's happening.

`def fizzbuzz(start_num, end_num)
start_num.upto(end_num) do |n|
str = ""
str += "fizz" if n % 3 == 0
str += "buzz" if n % 5 == 0
str += n if str.empty?
puts str
end
end

fizzbuzz(1, 100)`

And when I run it....
`assessment_109.rb:7:in `+': no implicit conversion of Fixnum into String (TypeError)`

Changing the += to a = in the last line works (and since it's an empty string, it outputs the same)

Did anyone else run into this?
Is this just a typo that I'm over thinking or am I completely missing something here?

Thanks! :)

Posted in Updating Forum_Posts getting routes error

Try to run rake routes and double check you have the correct route name. And it doesn't look like you allowing the user_id in your strong params. Try changing to:

def forum_post_params
  params.require(:forum_post).permit(:body, :user_id)
end

And I'm not 100% positive but I'm pretty sure you don't have to reset the user in your edit method since you're assigning it when it's created. Might cause an issue if someone other than the original user tries to edit the post.
Hope this helps. :)

Posted in let users edit their own posts

You should take a look at his episode on the pundit gem. Sounds like exactly what you need. :)

Have you considered using the apartment gem and creating a new tenant when a new user is added? I have a similar situation in my project for subdomains but it with domains as well.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.