If you are following http://guides.rubyonrails.org/getting_started.html or similar, you may get the awful “undefined method `title' for nil:NilClass” problem. In that case, just go over to app\controllers\post_controllers.rb and put all "private" headers at the bottom. For example, if you have,
private
def post_params
params.require(:post).permit(:title, :text)
end
which you should, as it's part of the tutorial, then make sure this block, and any others that say anything about being private, as far down the column as possible. Here's how mine ended up looking afterward:
class PostsController < ApplicationController
def new
end
def create
@post = Post.new(post_params)
@post.save
redirect_to @post
end
def show
@post = Post.find(params[:id])
end
private
def post_params
params.require(:post).permit(:title, :text)
end
end
--
Condensed from: http://stackoverflow.com/questions/17810348/undefined-method-title-for-nilnilclass-rails-guides-tutoraial
Friday, November 22, 2013
Tuesday, November 19, 2013
How To Use An Oven to Save A Water-Damaged iPhone
I've put my iPhone in the oven two times now, all in the name of saving it from water damage. It's worked perfectly both times with no adverse affects.
Please note, I take no responsibility if something goes horribly, horribly wrong with your phone. I've used this on my iPhone 4. Here's how.
Get a container you can put in the oven (glassware is great.) Put a bunch of rice in there (enough to cover a phone.) Turn off the iPhone (doesn't matter if battery is charged or not, I've tried it both ways), and make sure to take off any case (except those clear sticker cases, which are ok) and stick the iPhone in there so that it is completely covered in the rice, INCLUDING ON THE BOTTOM. You do not want your iPhone touching anything but rice. I suggest white rice, but not sure if any other type would be bad. This will prevent the hotter-to-the-touch glass from contacting the phone.
So stick your phone in the oven and turn it on. I have used convection and normal bake modes. Honestly I think the convection method worked better. If you don't have that, the normal mode should be ok. Set it to the lowest temperature, which is for me 170 degrees. I'd suggest not over 180. 200 is an absolute keep-your-fingers-crossed maximum, for my money.
How long? I'd say increments of 20 minutes. Once I forgot it and it was in there for 40 minutes straight. No worries, but stay on the safe side. Just check it out, make sure battery acid hasn't exploded everywhere (or, that it's not TOO hot to the touch; it should be kinda hot like you left it in the sun a long time, but you should still be able to handle it.) Unless you dropped it in the toilet or some other embarrassing thing, the phone should be good to go after 20 to 30 minutes, depending on convection methods etc.
How do I feel comfortable doing this?
I have been in the sauna at the gym before, where it gets up to 180 degrees. The worst thing that happened is my phone showed a exclamation point warning and locked the phone until it cooled down. For the iPhone in oven method, just turn it off, then wait for it to cool down before using.
To cool down your phone: DO NOT stick it in the freezer or refrigerator. There be moisture in there. You can let it cool down on its own, or take it in your hands and let the heat transfer away to you.
Why rice?
Rice has natural drying properties. Some water damage phone guides say to use only rice, but that is unnecessarily long.
The problems I solved with my phone:
One time when it was really damaged and showed only some strange blue screen with garbled colors.
Another time (today, actually) when it was possessed (by water), and it was doing all sorts of random home-button functions (mostly sending me to Voice Control or whatever it's called.
Any questions, I'm happy to answer.
Please note, I take no responsibility if something goes horribly, horribly wrong with your phone. I've used this on my iPhone 4. Here's how.
Get a container you can put in the oven (glassware is great.) Put a bunch of rice in there (enough to cover a phone.) Turn off the iPhone (doesn't matter if battery is charged or not, I've tried it both ways), and make sure to take off any case (except those clear sticker cases, which are ok) and stick the iPhone in there so that it is completely covered in the rice, INCLUDING ON THE BOTTOM. You do not want your iPhone touching anything but rice. I suggest white rice, but not sure if any other type would be bad. This will prevent the hotter-to-the-touch glass from contacting the phone.
So stick your phone in the oven and turn it on. I have used convection and normal bake modes. Honestly I think the convection method worked better. If you don't have that, the normal mode should be ok. Set it to the lowest temperature, which is for me 170 degrees. I'd suggest not over 180. 200 is an absolute keep-your-fingers-crossed maximum, for my money.
How long? I'd say increments of 20 minutes. Once I forgot it and it was in there for 40 minutes straight. No worries, but stay on the safe side. Just check it out, make sure battery acid hasn't exploded everywhere (or, that it's not TOO hot to the touch; it should be kinda hot like you left it in the sun a long time, but you should still be able to handle it.) Unless you dropped it in the toilet or some other embarrassing thing, the phone should be good to go after 20 to 30 minutes, depending on convection methods etc.
How do I feel comfortable doing this?
I have been in the sauna at the gym before, where it gets up to 180 degrees. The worst thing that happened is my phone showed a exclamation point warning and locked the phone until it cooled down. For the iPhone in oven method, just turn it off, then wait for it to cool down before using.
To cool down your phone: DO NOT stick it in the freezer or refrigerator. There be moisture in there. You can let it cool down on its own, or take it in your hands and let the heat transfer away to you.
Why rice?
Rice has natural drying properties. Some water damage phone guides say to use only rice, but that is unnecessarily long.
The problems I solved with my phone:
One time when it was really damaged and showed only some strange blue screen with garbled colors.
Another time (today, actually) when it was possessed (by water), and it was doing all sorts of random home-button functions (mostly sending me to Voice Control or whatever it's called.
Any questions, I'm happy to answer.
Thursday, October 31, 2013
How to Trade Properties in Monopoly for iPhone
In "bird's-eye" view mode (looking at the whole board):
- At the bottom of the horizontal screen, you will see a number of square buttons. If you have not already rolled, you will see a some dice.
- You should also see two deed cards (they actually look more like old-school wheel iPods) with red and green arrows facing each other. Tap this button.
- If there are more than two players, click the icon of the player you want to trade with. Then tap the green checkmark button.
- Now you are able to tap that players cards, and view them up-close. Tap the one you want.
- Tap the card once more, once it is already shown close-up. This will select it, and you will see a green checkmark in that card's upper-right hand corner. To deselect, just tap it again.
- Tap the green checkmark button at the bottom of the screen to exit close-up view.
- Continue doing this for any other properties, and money trades. You can select more than one property per trade.
- Once you are finished, tap the green icon on the bottom of the screen, with the hand holding a deed card (looks like a calculator.)
- If you are trading AI, you may choose to offer more if they decline your first offer.
How to Mortgage a Property in Monopoly for iPhone
Once you own a property:
- From the "bird's-eye" view, tap the property you want to mortgage.
- Tap a second time to see the Title Deed (card) for the property you want to mortgage.
- On the left, on the black card saying who owns the property (must be you to mortgage), there is a green button with the icon of what appears to be a bank. Click on that to mortgage, and confirm.
Wednesday, September 25, 2013
What To Do If iTunes Won't Let You Change a File Type (Music, iTunes U etc.)
If you have just imported a file into your iTunes library, and are having trouble changing the file type of any other properties under "Get Info," this brief guide is for you.
The problem is easily fixed. Go to the folder or original destination where the file you imported is. It is likely that the file has been marked "Read Only," which is preventing you from making changes. To fix this, follow these instructions from the Microsoft Help page (in Windows):
After deleting the troublesome files from iTunes, just re-import the files after you changed them to not be read-only. Now you can change them freely!
The problem is easily fixed. Go to the folder or original destination where the file you imported is. It is likely that the file has been marked "Read Only," which is preventing you from making changes. To fix this, follow these instructions from the Microsoft Help page (in Windows):
Now that you have done that, delete the files that you already imported into iTunes, and do so from within iTunes. This will get rid of the unchanging files. iTunes may ask if you want to get rid of your original files, but say no; you will re-import these shortly.
- Find the file you want to edit. Right-click the file, and then click Properties.
- Click the General tab, clear the Read-only check box, and then click OK.
- Edit and save your file as needed.
After deleting the troublesome files from iTunes, just re-import the files after you changed them to not be read-only. Now you can change them freely!
Wednesday, September 18, 2013
How To Find Bookmarks.plist in Windows 8 and 7
Here is how to find bookmarks.plist on Windows 8, 7, and possibly Vista. Apple and Windows really hide this from users, so this guide will save you quite a bit of time.
- Access the "Run" command from the start menu. On Windows 8, put the mouse cursor in the lower-left hand corner of the screen, then double-click; select "Run."
- Type the following in the Run command line: %appdata%
- Hit enter.
- Find the "Apple Computer" file in the folder that pops up for you, courtesy of the Run command.
- Open "Apple Computer," then open "Safari"
- You will see "Bookmarks.plist" here.
Bookmarks.plist contains your reading list and bookmarks info for Safari. Safari unfortunately does not allow easy moving around and management of the "reading list" feature. Possibly, you could just switch a new Safari installation's file with the old bookmarks.plist file you have, thus importing it like that.
Friday, September 6, 2013
How to Fix Errors Related to ImageMagick When Using Paperclip
While following along with a Team Treehouse tutorial on Installing Paperclip, I was getting a Paperclip::Errors::NotIdentifiedByImageMagickError. This would happen whenever trying to upload an avatar or change an image album.
What went wrong first: On the ImageMagick page, under Binary Windows Installations, I first used ImageMagick-6.8.6-9-Q16-x86-dll.exe. However, after much difficulty I could not get that to work in Treebook. The program "IMDisplay" would run normally on my PC, once I clicked the desktop file, but it was not working at all for my online purposes.
In the end, I deleted that installation (Windows Uninstall.) Going back to the IM download page (binary, windows, same page as before) I instead elected to go for ImageMagick-6.8.6-9-Q16-x64-dll.exe. I am running Windows 8 x64, so that seemed more suitable (the descriptions on the same page say which are Win32 and which are Win64.)
An interesting note: I did not shut down any other running apps during my first installation of IM. It did "recommend" this, but I did not elect to do it. However, on the second approach, with a different installation, I closed all other apps, being extra cautious.
Once I began installing IM for the second time, I carefully read all notes. I ran the following in a bare (not "rubified") CMD window (In Windows 8, Run>CMD). (These are per the instructions that can be found in the IM install wizard, once it is successful.)
First type: C:\Users\MyAdminUsername>convert wizard: wizard.jpg
Hit enter, then type: C:\Users\MyAdminUsername>convert wizard.jpg win:
After "convert wizard: wizard.jpg" it won't really say anything, and will just give the "C:\ ..." prompt again. However keep going with the second "convert..." command as mentioned above. Then it will open the converted file, showing a successful installation.
What went wrong first: On the ImageMagick page, under Binary Windows Installations, I first used ImageMagick-6.8.6-9-Q16-x86-dll.exe. However, after much difficulty I could not get that to work in Treebook. The program "IMDisplay" would run normally on my PC, once I clicked the desktop file, but it was not working at all for my online purposes.
In the end, I deleted that installation (Windows Uninstall.) Going back to the IM download page (binary, windows, same page as before) I instead elected to go for ImageMagick-6.8.6-9-Q16-x64-dll.exe. I am running Windows 8 x64, so that seemed more suitable (the descriptions on the same page say which are Win32 and which are Win64.)
An interesting note: I did not shut down any other running apps during my first installation of IM. It did "recommend" this, but I did not elect to do it. However, on the second approach, with a different installation, I closed all other apps, being extra cautious.
Once I began installing IM for the second time, I carefully read all notes. I ran the following in a bare (not "rubified") CMD window (In Windows 8, Run>CMD). (These are per the instructions that can be found in the IM install wizard, once it is successful.)
First type: C:\Users\MyAdminUsername>convert wizard: wizard.jpg
Hit enter, then type: C:\Users\MyAdminUsername>convert wizard.jpg win:
After "convert wizard: wizard.jpg" it won't really say anything, and will just give the "C:\ ..." prompt again. However keep going with the second "convert..." command as mentioned above. Then it will open the converted file, showing a successful installation.
Subscribe to:
Posts (Atom)