RJS: Button to set style to visible

Hi everybody!

I’m back with a new question, this time about ruby on rails with
javascript

I have a hidden div in my page and like to set its style to visible if
someone clicks a button. But this:

add new item

To add a non existing item choose the type of media:

<%= button_to_function '+ new item', update_page { |page| page.setStyle('create_new_item', '{visibility:visible}')} %>
<%= form_remote_tag :url => {:action => 'items/create'}, :html => {:multipart => true}, :update => 'create_new_item' %>

Challenge Title:

<%= text_field_tag 'item' 'title'%>

Description:

<%= text_field_tag 'item' 'description'%>

Challenge Photo:

<%= file_field_tag :picture%> <%= submit_tag 'Create' %>

only renders this javascript part:

There is no element and also not the change of the style included.

I think it’s a realy easy one, but I’m new with ruby on rails, so for me
it isn’t :slight_smile:

thanks for the help, manuel

Is there anybody who can help me? I’m also happy with a tutorial, I
couldn’t find a good one.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs