From: 7stud -- Date: 2009-08-10T18:09:10+09:00 Subject: Re: Font selector using radio button Tom Dunn wrote: > I have looked all around to try and find an answer to this. I have the > Agile book and although it has lots of information, it has relatively > little on radio buttons. I have a website in which I want users to be > able to format their posts in relation to font and color. My goal is to > allow them to click a radio button next to their choice of font and > their choice of color. So far I have been unable to find anything in > the book, on this site, or on the internet to help me out. First, this isn't a forum for rails questions. This is a general ruby programming forum. rails is a complex piece of software written in ruby. People who use that complex piece of software often hang out together and discuss various issues that they are having with the software. You need to locate one of those places. They are generally titled "Ruby on Rails" or just "Rails". Second, your question really has nothing to do with rails nor with ruby programming in general. rails software executes on "the server side". A person looking at your web page is on the "client side". In between the server side and the client side is a bunch of cables commonly called the internet. The font and color choices that you want to give your users can all be handled on the client side with javascript and css. The server side shouldn't be bothered with such mundane details. You can add a simple onclick javascript function to your radio buttons that you can use to immediately change any css property, e.g. font size and colors. I guess if you want to save the user's choices for the next time they visit, you also need to set a cookie. Once again, you can do that with javascript. If you set a cookie with javascript, then all subsequent requests that the client sends to the server will include the cookie. Then you can have your rails app read the cookie and send back a page that has the font and color set according to the choices read from the cookie. In any case, that is all stuff you should have learned before ever even attempting rails. Web programming requires a general knowledge of html, css, javascript, and at least one server side programming language (e.g. php, java, python ruby). If someone led you to believe that learning rails would obviate the need to learn those subjects first, they were sadly mistaken. You are flying blind without those subjects, and if any little thing goes wrong with your rails program, you have no skills to solve the problem. -- Posted via http://www.ruby-forum.com/.