Looks odd, maybe it should be params instead. You might want to revisit your testimonial_member_id method as well, this: def testimonial_member_id I'm not sure of the logic for testimonials so you might be able to go with something more like: def = Testimonial.find_by(member_id: testimonial_member_id) The low precedence of and and or cause a lot of problems so you're better off sticking to & and ||. Your show template presumably needs a as well so you might want to say = testimonial.first before render 'show' too.Īlso, I've changed your and operator to & since you're generally better off pretending that and doesn't exist. But, notice that nothing in get_testimonial initializes so get_testimonial will end up trying to simple_form_for(nil).Ĭhanging the bottom of get_testimonial to something more like this: if invitations.any? & = Testimonial.new If you go through the get_testimonial controller, you can end up at: render 'new'Īnd that will render the HAML in question. May someone help me see why is returning nil? If the variable is the same I'm passing on the new function?ĪFAIK will try to call so that's where the problem most likely originates. If invitations.any? and testimonial.blank?ĭef = Testimonial.find(testimonial_member_id) Invitations = current_user.workshop_invitations.accepted_or_attended Testimonial = Testimonial.where(member_id: testimonial_member_id) The controller is the following: class TestimonialsController < ApplicationController = f.submit 'Submit testimonial', class: 'button' = sanitize('Any testimonial along with your name and profile picture might be used for the promotion of codebar (website, prospectus, etc).') Placeholder: 'Use this space to write a testimonial about the event(s) you participated.' I'm receiving this error when trying to render the haml below: %section#banner require ( :event ).The error: undefined method `model_name' for nil:NilClass (NoMethodError) destroy redirect_to admin_events_path, alert: "聚会已被删除" end private def event_pramas params. update ( event_pramas ) redirect_to admin_events_path, notice: "更新成功" else render :edit end end def destroy = Event. Rendered common/_ (0.6ms)Ĭompleted 200 OK in 78ms (Views: 73.9ms | ActiveRecord: 2.5ms)Ĭlass Admin :: EventsController < ApplicationController before_action :authenticate_user! before_action :admin_required layout "admin" def index if params. User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ?, ] (0.1ms) SELECT COUNT(*) FROM "events" INNER JOIN "cart_items" ON "events"."id" = "cart_items"."event_id" WHERE "cart_items"."cart_id" = ? ] I installed Metasploit with: Kali package via apt. Rendered welcome/ within layouts/application (0.5ms)Ĭart Load (0.3ms) SELECT "carts".* FROM "carts" WHERE "carts"."id" = ? LIMIT ?, ] Error: undefined method map for nil:NilClass Did you mean tap. The error message is undefined method map for nil:NilClass. Rendering welcome/ within layouts/application But when I click connection, PLugin is generating ruby rails error. Processing by WelcomeController#index as HTML Rendered /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/template_ within rescues/layout (56.6ms) Rendered /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_ (1.1ms) Rendering /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_ Example of Undefined method for nil:NILClass. This indicates that the datapill was not provided any value at runtime. The Undefined method for nil:NILClass occurs when you attempt to use a formula on a blank datapill. Rendered /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/_ (1.9ms) Troubleshoot undefined method error under 3 min. Rendering /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/_ Rendered /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/_ (4.9ms) Rendering /Users/wangdonghui/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.3/lib/action_dispatch/middleware/templates/rescues/template_ within rescues/layout
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |