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! While you're at it, check out some resources Treehouse students have shared here.

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

Ruby Building Web Apps with Sinatra Updating Data A Form to Edit an Existing Page

instance variable @content not auto-filling in the edit form... anyone else with this issue?

<h1>Edit Page: <%= @title %> </h1>

<div> <form> <fieldset> <label for="content">Content:</label> <textarea rows="10" cols="50" name="content" id="content"><%= @content %></textarea> </fieldset> <input type="submit"> </form> </div>

<a href="/">Back to Index</a>

Johnathan Guzman
Johnathan Guzman
7,432 Points

What does your controller look like?

dianacapunay
dianacapunay
2,715 Points

I have the same issue but I can't see the answers for this post. Here is my code:

<h1>Edit Page: <%= @title %></h1>

<div>
    <form>
        <fieldset>
            <label for="content">Content:</label>
            <textarea name="content" id="content" cols="50" rows="10"><%= @content %></textarea>
        </fieldset>
        <input type="submit">
    </form>
</div>

<a href="/">Back to Index</a>

Many thanks in advance for your help!

Elisa Burghard
Elisa Burghard
9,276 Points

dianacapunay can you post what your code looks like in your wiki.rb file?

1 Answer

Thank you everyone for your help! Issue resolved.