learn-co-curriculum / activerecord-lifecycle-reading Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
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:in
block 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:in
modules_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:in
helper'
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:in
class: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:in
module: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:in
block 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:in
require'
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:in
require'
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:in
load_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:in
block 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:in
require'
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:in
require'
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:in
load'
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:in
each'
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:in
setup'
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:in
run'
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
eval' from /Users/aaronfigueroa/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in
'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?
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.)
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.
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
The tests were failing because no code for routes was included. Since this felt like a walk-through lab, maybe this was an oversight?
line#180
Currently:
[callbacks]: http://guides.rubyonrails.org/active_record_callbacks.html**.**
Should be:
[callbacks]: http://guides.rubyonrails.org/active_record_callbacks.html
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.
Specify that rake db:migrate is needed
This was a readme. upon running learn i got this error
Failures:
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
line 36 spec/features/post_spec.rb
we must should note that
Should or must, not must should :D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.