Question: I have never worked much with web technologies like Javascript, PHP etc. But now I've got the following situation: 

• I have a Java project. Some classes, a simple AWT gui, some input fields, two output fields. Nothing much. The gui uses my logic classes to process the input and displays the output in the output fields. 

• For practizing some (for me new) web technology I would like create a HTML page which offers the same functionality: collect input, processing logic, display output. 

My questions: 

• Is this a valid approach? I mean gathering data on the HTML page, accessing Java code and displaying the results. Or would I better try to process the information only in Javascript? As I said, never done Javascript before. I don't know what's possible there. 

• What technologies can I consider relevant? Javascript? ASP? PHP? JSP? 

Some input would be really nice. Almost done with my CS master degree but web technologies have never been much of my interest and neither a part of my curriculum. 

Thanks!

Answer: 
The problem is the method you're calling. [`capitalize`](http://ruby-doc.org/core-1.9.3/String.html#method-i-capitalize) makes no modification to the string, but rather returns a new string. You want to call [`capitalize!`](http://www.ruby-doc.org/core-2.1.2/String.html#method-i-capitalize-21):

```
x = "apple"
puts x.capitalize # "Apple"
puts x # "apple"
x.capitalize!
puts x # "Apple"

```

---

Another option would be to create a new array using [`collect`](http://ruby-doc.org/core-1.9.3/Array.html#method-i-collect) like so: 

```
array = ["apple"]
new_array = array.collect do |x|
  x.capitalize
end
puts array # ["apple"]
puts new_array # ["Apple"]

```
When you do

```
x.capitalize

```

it returns a copy of the string. To do what you want, you should change that line to

```
x.capitalize!

```

which will modify the existing element, instead of returning a copy.