Help on implementing rails from html with php


#1

Hi guys, just started using rails and is trying to implementing the
present html with some rails…

However i met this problem when i am trying to port over some php code
in html to rails and i cant find any method to successful convert the
php codes.

Below is a feature i tried to implement in rails way:

there are 2 buttons on the html. Besides these 2 buttons is an infobox.
So, whenever one of the buttons is pressed, the infobox have to show the
respective information assigned to each button. At any one time, only
one button can be pressed and the infobox have to change the information
displayed inside it accordingly and immediately.

Here is the code i did and not sure wat’s wrong:

button info

Info

Button1 some text here
Button2 some text here
2 buttons Button 1 Button 2

Thanks for any help anyone can provide me.


#2

bao lee wrote:

Hi guys, just started using rails and is trying to implementing the
present html with some rails…

Anyone can help???


#3

bao lee wrote:

Hi guys, just started using rails and is trying to implementing the
present html with some rails…

Firstly, you’ve given the buttons the same IDs as the divs they’re
referring to. That can’t work. Secondly, you’ve not taken care of
making anything disappear. Thirdly, Effect.Appear() et al need to be
called as constructors. Finally, although it’s understandable that you
aren’t aware of it, the correct list for this question would be
removed_email_address@domain.invalid, because it’s a scriptaculous
problem rather than about Rails itself.

Oh, the code? Try this: :slight_smile:

button info

Info

Button1 some text here
Button2 some text here
2 buttons Button 1 Button 2

Tested to be fine in Firefox, although I’ve jiggled your tree a bit, so
to speak.


#4

Alex Y. wrote:

bao lee wrote:

Hi guys, just started using rails and is trying to implementing the
present html with some rails…

Firstly, you’ve given the buttons the same IDs as the divs they’re
referring to. That can’t work. Secondly, you’ve not taken care of
making anything disappear. Thirdly, Effect.Appear() et al need to be
called as constructors. Finally, although it’s understandable that you
aren’t aware of it, the correct list for this question would be
removed_email_address@domain.invalid, because it’s a scriptaculous
problem rather than about Rails itself.

Oh sorry about that… didnt know that the nature of the problem is not
rails itself… thanks for all your trouble.