The best (easiest way) to run through MVC and check whether everything is correct?
I am getting a little dazzling and I feel like there should be simple improvements in such error messages as actually After breaking the code of my app, after adding the code in a small quantity and I want to trouble them in shooting myself. Thanks for the tips! Edit Perhaps a typical approach to troubleshooting specific issues will take the way, View (home / index.erb.html) < / P> View (in invitation / new.erb.html) Controller model routes.rb You can create request glasses for each controller Request specs follow the request in all ways to see from the controller, and if there is an error, this request will appear in the device. It may take time to set up, but will save you for a long time in the future, as you would like to roll out a new version of your website, then manually There is no need to test.
undefined Method # invites_path 'for # & lt; # & Lt; Class: 0x00000105ad5cb8>: 0x00000105820b30>
Link_to is not used to link & lt;% =% & gt; & Lt; %% & gt; Instead.
& lt;% if @ user.invitation_limit & gt; 0% & gt; & Lt;% link_to 'Send Invitation', new_invitation_path% & gt; (& Lt;% = @ user.invitation_limit%> left) & lt;% end% & gt;
for & lt;% = error_messages_: invitation% & Gt; @Ivision for & lt;% form_ F | & Gt%; & Lt; P & gt; & Lt;% = f.label: Recipient_Email, "Friend's Email Address"%> & Lt; Br / & gt; & Lt;% = f.text_field: recipient_email% & gt; & Lt; / P & gt; & Lt; P & gt; & Lt;% = f.submit "Invitation!" % & Gt; & Lt; / P & gt; & Lt;% end% & gt;
Class invitations controller & lt; ApplicationController def new @invitation = invite.new end def @ invite = invitation New (Consulting:: Invitation)) @ Invitation. Sign = Current_User if @ Invitation. Mailer.deliver_invitation (@ invitation, signup_url (@ invitation.token) Flash [: notice] = "Thanks, invitation sent." Redirect_to projects_url else flash [: notice] = "Thanks, we will inform you when we are ready." Redirect_to root_url End End Render: Action => 'New' and end
class invitation & lt; ActiveRecord :: base is_to: sender, class_name = & gt; 'User' is_one: recipient, class_name = & gt; 'User' attr_accessible: recipient_email,: sender_id ,: sent_at,: token end
resources: home ,: Only: & gt; : Indicator processing resource: Invitation
No comments:
Post a Comment