# Redbox implementation not showing anything

**URL:** <https://www.ruby-forum.com/t/redbox-implementation-not-showing-anything/163227>\
**Category:** Rails\
**Created:** [March 18, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/redbox-implementation-not-showing-anything/163227 "2009-03-18T13:01:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [March 18, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/redbox-implementation-not-showing-anything/163227/1 "2009-03-18T13:01:17Z")

</div>

Hi all,

Im trying to implement redbox for submitting some small forms. Here’s  
the code im using.

#redbox link  
\<%= link\_to\_remote\_redbox ‘Change Password’, :url =\> {:controller  
=\> :users, :action =\> :change\_password, :id =\> @user.id}, :method  
=\> :get %\>

#users controller

def change\_password  
@user = User.find(params[:id])  
respond\_to do |format|  
format.html  
format.js {render :layout =\> “modal”}  
end  
rescue ActiveRecord::RecordNotFound  
permission\_denied  
end

#modal layout

 Invoicing \<%= javascript\_include\_tag :defaults %\> \<%= javascript\_include\_tag "redbox"%\>

```
<%= yield %>

```

#change\_password.js.erb

\<% form\_for :user, :url =\> changed\_password\_user\_path(@user), :html =\> {:method =\> 'put'} do |f| %\> 
Old : \<%= f.password\_field :old\_password, :size =\> 15 %\>

New : \<%= f.password\_field :password, :size =\> 15 %\>

Confirm : \<%= f. password\_field :confirm\_password, :size =\> 15 %\>

\<%= f.submit "Change" %\>

\<% end %\> \<%= link\_to\_close\_redbox "Cancel" %\>

Now when i click the link, the RedBox Overlay is shown but the form  
does not turn up. Only the overlay is shown. If i check the dev log,  
it says the action has been successfully called and the rendering has  
been done.  
What am i doing wrong here? Any ideas?  
My best guess is that the JS is screwing up things somewhere. Or, I  
could be doing something basically very wrong… 😃

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [March 19, 2009, 11:17am UTC](https://www.ruby-forum.com/t/redbox-implementation-not-showing-anything/163227/2 "2009-03-19T11:17:55Z")

</div>

link\_to\_redbox works though.

#link\_to\_redbox link

#in the view with the above link

 watsup? \<%= link\_to\_close\_redbox "Cancel" %\>

This shows a white box in the center, slightly above center. The  
spinner.gif does not get hidden even after “watsup?” is rendered. and  
“watsup?” is rendered at the very bottom of the white box and a little  
outside it too.

When I use link\_to\_remote\_redbox to render the form, in FF, I tried  
selecting an arbitrary part of the result (which is just the black  
transparent RB\_overlay) and viewing source.  
that shows the elements of the form and their full details but whats  
selected is only the source for the RB\_overlay div. So im guessing the  
form is rendered but im not able to see it for some reason.  
Another interesting thing is that when i click on “View source” for  
that arbitrary selection as described above, Firebug throws an error  
at the element.hide() function source code. The error message itself  
is VERY long and highly truncated so im not pasting it here but will  
try it if anyone thinks itll help. Firebug throws this error when i  
click on “View source”.  
Could this element.hide() error and the spinner not hiding after  
rendering “watsup?” have some connection?

getting a bit desperate here… all other options for a modal form seem  
more complicated so I want to make sure im not making a silly mistake  
before I jump into trying the other solutions.

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [March 19, 2009, 11:31am UTC](https://www.ruby-forum.com/t/redbox-implementation-not-showing-anything/163227/3 "2009-03-19T11:31:58Z")

</div>

I just had to scroll up to see the form because it was not being  
rendered at the center.

im open to getting kicked now. free kicks for all!
