undefined method `message’ for #
If your a seasoned Rails ninja, you might want to just skip this. However, if you have received this message in your rails application, the below might help you find what went wrong. This is by no means a end all solution, but I stumbled across this error just now and wanted to archive it in the case that I forget in the future.
This error came from an attempt of using the following code:
<div id="add_request_form">
<% form_remote_tag :url =>{:action=> :request_approval, :id=>@job.id },:update => 'request_history',
:position => :bottom do %>
<label for="approver_request[message]" style="float: none; display: block; margin: 0, padding: 0; text-align: left;">Approval message</label>
<%= text_area :approver_request, :message, :cols=>'60', :rows=>'7'%><br style="margin-top: 10px;" />
<%= submit_tag "Request Approval"%>
<% end %>
</div>
<h4>Request History</h4>
<dl id="request_history">
<% for ar in @approver_request do %>
<dt>On <%= ar.created_at %> an approval request was sent to <%= User.find(ar.user_id).name %> (<%= User.find(ar.user_id).email %>)</dt>
<dd><%= ar.message %></dd>
<% end %>
</dl>
Above, there is the code for sending a request for approving a job that has been entered into the web application. This code uses the remote_form_tag helper to allow updating the dl object without having to reload the page.
However, the above code will produce the error of "undefined method `message' for #<Array:0x23022d8>" because you cannot share the same variable on the page when one of them is being used for submitting data!!
Here is what I ended up with:
<div id="add_request_form">
<% form_remote_tag :url =>{:action=> :request_approval, :id=>@job.id },:update => 'request_history',
:position => :bottom do %>
<label for="approver_request[message]" style="float: none; display: block; margin: 0, padding: 0; text-align: left;">Approval message</label>
<%= text_area :approval_request, :message, :cols=>'60', :rows=>'7'%><br style="margin-top: 10px;" />
<%= submit_tag "Request Approval"%>
<% end %>
</div>
<h4>Request History</h4>
<dl id="request_history">
<% for ar in @approver_request do %>
<dt>On <%= ar.created_at %> an approval request was sent to <%= User.find(ar.user_id).name %> (<%= User.find(ar.user_id).email %>)</dt>
<dd><%= ar.message %></dd>
<% end %>
</dl>
Remember VI
This is really just for myself to have a reference for using the text editor named VI. Your welcome to use it yourself, perhaps I will make a PDF later to help me cheat more
until then, on with the non-sense commands:
looking for text
- when looking for text and your cursor is on the word you want to search for, use the * character to search for the pattern going forward in your document
- setting the "incsearch" option will show the first match or the pattern while you are still typing it
- setting the "hlseach" option will highlight all of the matches in the document when searching
moving around
- use % to jump from open brace to its matching close brace or from open if statement
- at the end of the brace or if statement, use [{ to jump back to its start of the {
- use gd to jump from the use of a variable to its local declaration
macros and repeating
- to make a macro:
- type "qa" to record into register "a"
- do all yer commands
- type "q" to stop recording
- to repeat the macro, enter number of times to repeat, then "@a"
- also, the "." will repeat any command you previously execute
How nuts and bolts are made
I like this video that shows off how nuts and bolts are made! Crazy to see the process, tools, and amount of time needed to create just nuts and bolts!
My favorite scenes are the nuts flying out while the are red hot.
Update: the video has been removed based on copyright issues :/
Untangaling my phone cord super fast
Your looking at that spiraled phone cord that has all of those loops (or extra twists,.. not sure what to call them) and its just making your phone look really messy, and your thinking "there has got to be a way to get all of these out faster than just letting gravity do the trick". These loops are taking up valuable stretching lengths! Also, they start to grow in numbers each time they appear. Here is one of mine:
So you might be asking "how do I fix these things!?"
First, the legal clause part:
I full admit that there is possibly a better way to do this, and I am not going to buy you a new phone cord if you ruin it. I have not ruined mine.
my solution
which does involve unhooking only one side, without any "hanging", "gravity-will-fix-it", and its quick to complete
Here is the basic outline:
- detach one side of the phone cord (best to start with end closest to the extra twist)
- take the jack and feed it in to all of its loops
- keep feeding through until you get to the extra twist that does not belong
- now get firm hold of the jack side in one hand
- get firm hold of the extra loop in other hand
- pull until its flat
Flying in SecondLife with body motion
I found this video about how you can use a 3D camera to capture your body motions and manipulate your character on SecondLife. I also found another piece of technology that will project SecondLife characters in 3D onto objects. This might be an interesting future for the home in about 10 to 20 years. Where we will interact with each other between two or more distance locations.















