Code Monkey home page Code Monkey logo

activerecord-lifecycle-reading's Issues

unknown error and unable to use rspec or learn.

This isnt a lab, more like a read along, but i found myself trying to decode this error message with the help of students and instructor Dylan. It seems as though we could not find a solution to what's going on with this error. I can not use learn or rspec or it will raise this error. If someone can help explain why this is going on, that would be helpful since all I did was fork and copy and ran rspec. I did not change any code except the one line in the model class.

// โ™ฅ learn
/Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/abstract_controller/helpers.rb:151:in rescue in block in modules_for_helpers': Missing helper file helpers//users/aaronfigueroa/development/rails/associations_and_rails/activerecord_lifecycle_reading_v_000/app/helpers/application_helper.rb_helper.rb (AbstractController::Helpers::MissingHelperError) from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/abstract_controller/helpers.rb:148:inblock in modules_for_helpers'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/abstract_controller/helpers.rb:144:in map!' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/abstract_controller/helpers.rb:144:inmodules_for_helpers'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/action_controller/metal/helpers.rb:93:in modules_for_helpers' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/abstract_controller/helpers.rb:108:inhelper'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/action_controller/railties/helpers.rb:17:in inherited' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionview-4.2.5/lib/action_view/test_case.rb:11:inclass:TestCase'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionview-4.2.5/lib/action_view/test_case.rb:10:in <module:ActionView>' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/actionview-4.2.5/lib/action_view/test_case.rb:8:in<top (required)>'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.4.0/lib/rspec/rails/example/helper_example_group.rb:10:in <module:HelperExampleGroup>' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.4.0/lib/rspec/rails/example/helper_example_group.rb:7:inmodule:Rails'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.4.0/lib/rspec/rails/example/helper_example_group.rb:4:in <module:RSpec>' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.4.0/lib/rspec/rails/example/helper_example_group.rb:3:in<top (required)>'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in require' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:inblock in require'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in load_dependency' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:inrequire'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.4.0/lib/rspec/rails/example.rb:4:in <top (required)>' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:inrequire'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in block in require' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:inload_dependency'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in require' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.4.0/lib/rspec/rails.rb:12:in<top (required)>'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in require' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:inblock in require'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in load_dependency' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:inrequire'
from /Users/aaronfigueroa/Development/rails/associations_and_rails/activerecord-lifecycle-reading-v-000/spec/rails_helper.rb:7:in <top (required)>' from /Users/aaronfigueroa/Development/rails/associations_and_rails/activerecord-lifecycle-reading-v-000/spec/features/post_spec.rb:1:inrequire'
from /Users/aaronfigueroa/Development/rails/associations_and_rails/activerecord-lifecycle-reading-v-000/spec/features/post_spec.rb:1:in <top (required)>' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:inload'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:in block in load_spec_files' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:ineach'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:in load_spec_files' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:102:insetup'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:88:in run' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:inrun'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:in invoke' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/exe/rspec:4:in<top (required)>'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/bin/rspec:23:in load' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/bin/rspec:23:in

'
from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in eval' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in'

Seems odd that this is a lab

All of the tests pass without modifying any files.

Maybe remove some code and at least make it a somewhat active, copy-and-paste code-along?

before_validation

The before_validation statement is already put in for you, but it's not supposed to be there until you get further down in the lab. You're actually supposed to write it in yourself.

Because of this, the Post.create doesn't behave as described in the lab. (It works when it "shouldn't" work.)

Fix Rspec test

On line 36 of post_spec.rb ,it says:
expect(page).to have_content("My edit")

It should expect "My Edit", with a capitalized "Edit", since it is being automatically capitalized before being validated.

this lab only has a finished reading button on the right

when you click on it as though you are finished reading and then go on to the next lesson the website will not persist the fact that it is completed (ie the green light will not stay green after a refresh).

I went ahead and forked the lab down to my computer and made the changes and then did a pull request. Then I clicked the button as though I was finished reading and it did persist this time (ie the light stayed green even after a page refresh).

basically the page is requiring that you fork - pass - pull the lab to get credit for it but the page only shows the "finished reading" button (as though you don't need to fork - pass -pull on this lab.

trivial but confusing nonetheless. It would be best to either get the page to reflect that it actually a fork - pass - pull lab and not just a read lab.

thanks,

lucas

Routes were missing

The tests were failing because no code for routes was included. Since this felt like a walk-through lab, maybe this was an oversight?

PostsController Update Method Not Working

Current code:

def update
	  @post = Post.find(params[:id])
	  @post.update(params.require(:post))
	  redirect_to post_path(@post)
	end

It gives me this error:

 1) form shows an update form that submits content and redirects and prints out params
     Failure/Error: @post.update(params.require(:post))
     
     ActiveModel::ForbiddenAttributesError:
       ActiveModel::ForbiddenAttributesError

What worked for me:

	def update
	  @post = Post.find(params[:id])
	  @post.update(params.require(:post).permit!)
	  redirect_to post_path(@post)
	end

I also don't understand why the routes aren't written in this ReadMe. If it's a ReadMe and it's not teaching routes, they should be written so we can focus on the material being taught. It's distracting.

rails c error // "Traceback"

Hi there! I received this error when trying to follow along with the instructions for this code-along while inside rails c running this command:

p = Post.create(title: "testing")

Error below:

Screen Shot 2020-11-11 at 8 54 31 AM

It wasn't the output that was described in the lesson.

Hope this helps! Thanks again :-)

incorrect test

This was a readme. upon running learn i got this error

Failures:

  1. form shows an update form that submits content and redirects and prints out params
    Failure/Error: expect(page).to have_content("My Edit")
    expected to find text "My Edit" in "My Post\nMy post desc"

in the spec it has:

describe 'form' do

it 'shows an update form that submits content and redirects and prints out params' do
@post = Post.create(title: "My Post", description: "My post desc")

visit edit_post_path(@post)

fill_in 'post[title]', with: "My edit"
fill_in 'post[description]', with: "My post description"

click_on "Update Post"

expect(page).to have_content("My Edit")

end
end

the fill in for "My edit" has lowercase e. i had to alter the test to uppercase to get it to pass

Typo

we must should note that

Should or must, not must should :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.