Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Failed generation of resource route for action

// description of your code here

These methods test that the routes for resources defined in routes.rb are working as expected. Call them from your functional (controller) tests.

Add the following 3 methods to test/test_helper.rb (updated for Rails 1.2.5 which no longer uses semicolons as a separator for the edit action):

# Test for routes generated by map.resource (singular).
def assert_routing_for_resource(controller, skip=[], nesting=[])
  routes = [
    ["new",'/new',{},:get], ["create",'',{},:post],
    ["show",'',{},:get], ["edit",'/edit',{},:get],
    ["update",'',{},:put], ["destroy",'',{},:delete]
    ]
  check_resource_routing(controller, routes, skip, nesting)
end
# Test for routes generated by map.resources (plural).
def assert_routing_for_resources(controller, skip=[], nesting=[])
  routes = [
    ["index",'',{},:get], ["new",'/new',{},:get], ["create",'',{},:post],
    ["show",'/1',{:id=>'1'},:get], ["edit",'/1/edit',{:id=>'1'},:get],
    ["update",'/1',{:id=>'1'},:put], ["destroy",'/1',{:id=>'1'},:delete]
    ]
  check_resource_routing(controller, routes, skip, nesting)
end

# Check that the expected paths will be generated by a resource, and that
# the expected params will be generated by paths defined by a resource.
# routes is array of [action, url string after controller, extra params].
def check_resource_routing(controller, routes, skip=[], nesting=[])
  # set a prefix for nested resources
  prefix = nesting.join('s/1/')
  unless prefix.blank?
    prefix += "s/1/"
  end
  # Add params for nested resources.
  # For each 'nest', include a ":nest_id=>'1'" param.
  params = {}
  nesting.each do |param|
    params["#{param}_id".to_sym] = '1'
  end
  # Test each of the standard resource routes.
  routes.each do |pair|
    unless skip.include? pair[0]
      assert_generates("/#{prefix}#{controller}#{pair[1]}",
        {:controller=>controller,
        :action=>pair[0]}.merge(pair[2]).merge(params), {}, {},
        "Failed generation of resource route for action #{pair[0]} /#{prefix}#{controller}#{pair[1]}")
      assert_recognizes(
        {:controller=>controller,
          :action=>pair[0]}.merge(pair[2]).merge(params),
        {:path=>"/#{prefix}#{controller}#{pair[1]}", :method=>pair[3]},
        {}, "Failed to recognize resource route for path #{pair[3]}:/#{prefix}#{controller}#{pair[1]}")
    end
  end
end





Altın Fiyatları
Revizyon ile Organize Matbaacılık Brnckvvtmllttrhaberi





Imvu - Center Panels

Centers panels without making them wider. Can be placed anywhere. This code may get several updates in the meantime due changes regarding new panels.

<style type="text/css">
#aboutme_panel, #contact_panel, #dev_panel, #wishlist_panel, #visitors_panel, #messages_panel, #tagcloud_panel, #stickers_panel, #collect_panel,#room_panel, #rankings_panel, #cool_panel, #gallery_panel, #friends_panel,	#streetteam_panel, #blog_panel, #music_panel, #rss_panel, #url_panel, #special_panel, #outfits_panel, #groups_panel, #video_panel, .imvucodes_net { margin-left:165px !important; }
#rightColumn { display:none !important; }
</style>



MyBannerCode - TextArea code (1st version)

The descriptions below are from my experiences.. :-)


<textarea>CODE HERE</textarea>


This code is problematic when used at imvu.

The code above, is a very basic version, but you can add size parameters and some other properties to the resulting textbox/area.
The code I was using in this description became quite long:

<center>
<textarea rows="7" cols="58" readonly="readonly" name="WKKBannerCode" title="WKK Banner Code for copying"><center>
<a href="http://www.imvu.com/catalog/index.php?manufacturers_id=7015570" target="_blank">
<img src="http://i32.tinypic.com/1zoukvn.png" border="0" alt="WitchyKat's Kloset" title="Step into the kloset!"></a><BR><FONT SIZE="1" FACE= "arial"><A HREF="http://tinypic.com/"> <FONT COLOR="white"> the above Banner is hosted at TINYPIC</a></FONT></center>
</textarea>
</center>




The closer tag for the textarea command seems to get lost when saving in the custom css box; and in my case, all the text I had after it too.

If using this code, you must re-add the lost textarea closer tag every time you edit that particular custom css box.

To obtain the correct code, you can go into safe mode and copy the code shown on the page BEFORE you even open the custom css box for editing.

BE AWARE!! If this missing textarea closer tag is not corrected, the page could become UNLOADABLE (gets stuck in a loading loop) in edit and preview modes and maybe safe mode too.
I think my page went unloadable because I had a table closing tag which was lost with the textarea closer. And because I had the offending code in the very first panel, (the About Me panel) it would never actually finish loading that first panel, and thus never get to loading the rest of the homepage either..

EXAMPLE:-
1. Edit custom css
2. Put in textarea code
3. Save custom css
4. Page displays with textarea somewhat correctly (*see below)
5. Edit custom css again
6. THE TEXTAREA CLOSER DISAPPEARS AT THIS POINT..
7. Edit custom css, REMEMBERING TO REPLACE TEXTAREA CLOSER TAG.
8. Save custom css
--repeats from step 4.--

So pay extra attention to your actions when editing your imvu homepage with this code in a panel.
Get the rest of your homepage done first, and put the textarea code in LAST, if you can.

I have once had to use google's cached webpage service to obtain an older version of my page (before I had put the code in) in order to get back some lost codes that a failure to fix the dropped textarea closer tag had caused.. (Google search for your imvu username, and go to the CACHED page, and view the page's source file. If all goes well you *should* then be able to retrieve older codes from your page, from within the source text..)


**In addition to the above mess, the code also had a tendency to make surrounding areas display incorrectly. For me, the text which I had put in after the textarea closer tag, was then displaying twice on my homepage...but this was only visible to me when logged in; if I viewed my page when logged out, the text was only showing once, as it was meant to be.

I have dared not use it on a product page, that has no safe mode; do that at your own risk I guess.

HP HELP allowed & non alloweds (INFO ONLY)

Allowed:

-can hide About Me panel entirely or partially with a sticker
-can hide About Me panel with the 'hide panel' feature provided by IMVU
-can change the font of the panel
-can change the 'online' status bar with code or sticker
-can change the info that is not your age with code (ie, "Looking For: my one true love" or "Relationship Status:Happily Singled" or "Location: Outer-Most Ring of Neptune")


Not Allowed:

-cannot change age with coding
-cannot rephrase age with coding (ie, "Age: 3+4+6+1+7"), even if the end result is your age
-cannot hide square ad at the top that a Guest sees with code/stickers
-cannot hide the 'report' or 'block' buttons at the top with code/stickers
-cannot use code/stickers/browser add-ons to hide the Blue Banners
-cannot use code/stickers/browser add-ons to hide the Shoutouts
-cannot use code/stickers/browser add-ons to hide the links at the bottom
-cannot use code/stickers/browser add-ons to hide the ad at the bottom


I don't know about hiding the About Me panel and then creating a whole new one, I'll have to ask that one.

from mommajack in homepage creation corner at forums.

IMVU code

// description of your code here

// insert code here..
<style>

	#headerlite, #header { background: black;}
	#header .left, #headerlite .left { color: black; }
	#header .right, #headerlite .right { color: black; }
	#header a, #header a:link, #header a:visited , #headerlite a,
	#headerlite a:link, #headerlite a:visited { color: #999999; }
	#outernav { background-color: black;}
	#outernav { color: #999999}
	#innernav a, #innernav a:link #innernav a:visited { color: #999999; }
	#contact_panel_header {display: none; border: none;}
	#contact_panel_body table {display: none;}
	#avBigPic img, msgAvNam img, #galimg0 img {border: 1px solid #2b2b2b;}
	#gallery_panel_header {display: none; border: none;}
	#avBigPic a font {display: none;}
	#headerbox {border: 1px solid #2b2b2b;}
	.msgLnks {display: none;}
	.msgwrap {border: 0; display: block; width: 270px; height: 150px; float: left;}
	#aboutme_panel_header {display: none;}
	#messages_panel_header {display: none;}
	.msgAvNam, .msgAvNam a, .msgTele { color: #666; !important}
	.kb_awesome {border: 1px solid #2b2b2b; background-color: #000; padding: 0px 10px 0 20px; margin: 30px 0 0 30px;}
	html>body .kb_awesomeHeader {height: 77px; width: 71px; background: url('http://kevburnsjr.com/dropBox/imvu_bulb_2.png') no-repeat top left; margin: 0; position: absolute;}
	.kb_clear {margin: 0; padding; 0; border: 0; background: 0;}
	html>body .kb_clear {border: 1px solid transparent;}
	.kb_sig { border: 1px solid #2b2b2b; padding: 20px 10px 70px 20px; margin: 30px 0 0 30px; background: #000 url('http://kevburnsjr.com/dropBox/imvu_corner.jpg') no-repeat bottom right;}
	.kb_sig a {color: #999;}
	.kb_sig a:hover {color: #fff;}

</style>

<div class="kb_clear">
</div>

<div class="kb_awesomeHeader">
</div>
<div class="kb_awesome">
	<p><strong>Welp,</strong></p>
	<p style="text-indent: 20px;">I thought and I thought and I thought, but i just couldn't come up with anything interesting to put in this box.  Maybe i need to start brainstorming a little more.  Or maybe i just need to start doing more.  Maybe i should start a blog or get a life or stop playing computer games.</p>
	<p style="text-indent: 20px;">Whatever, I'm having fun skinning this EGREGIOUSLY customizable interface.</p>
</div>

<div class="kb_awesomeHeader">
</div>
<div class="kb_awesome">
	<p><strong>Besides,</strong></p>
	<p style="text-indent: 20px;">If i want another box, i just make one :)</p>
</div>

<div class="kb_sig">
	<a href="http://kevburnsjr.com">www.kevburnsjr.com</a>
</div>

<script type="text/javascript">

</script>