Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
MaryAnn Eleanya8,626 Points
I don't know what is wrong?
require "sinatra" get "/input" do erb :input end post "/reverse" do @string= String.reverse(params[:string]) end
<form method = "post" action = "/reverse"> <input type= "text" name ="string"> <input type = "submit"> </form>
Alexander Davison65,469 Points
.reverse isn't a method directly on the
String class, it is a method on its instances.
my_string = 'hello world' String.reverse(my_string) # invalid my_string.reverse # valid