Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMer Gilmartin
1,529 Points[resolved]ArgumentError in controller wrong number of arguments
I'm trying to understand what is happening here
When I start the rails server for my app. I'm getting an
ArgumentError in StaticPagesController#help_seller_signup
wrong number of arguments (0 for 1)
StaticPagesController#help_seller_signup
def help_seller_signup
end
help_seller_signup.html.erb
<%= link_to "Sign up", sellersignup_path, class: "btn btn-lg btn-primary" %>
routes.rb
get 'help_seller_signup' => 'static_pages#help_seller_signup'```
application trace
pp/models/user.rb:3:in `<class:User>'
app/models/user.rb:1:in `<top (required)>'
app/helpers/sessions_helper.rb:23:in `current_user'
app/helpers/sessions_helper.rb:35:in `logged_in?'
app/views/static_pages/home.html.erb:15:in `_app_views_static_pages_home_html_erb__565785473__622525708'
The page was working before. I know I made a change that caused it.
The source is pointing to the def destroy(id) default method. Which is puzzling as the app shouldn't be deleting anything on the front page.
It's pretty interesting though. I have't ran into this with the to-do app or anything and I wonder if its because I'm experimenting with a more complex relationship. User has a has_many and a has_one relationships.
Mer Gilmartin
1,529 PointsMer Gilmartin
1,529 PointsFound the answer, in the user controller I had has_many :bookings, dependent: destroy rather than has_many :bookings, dependent: :destroy (note the : before the destroy in the second)