Skip to content

Instantly share code, notes, and snippets.

@andyjeffries
Created May 13, 2009 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyjeffries/110949 to your computer and use it in GitHub Desktop.
Save andyjeffries/110949 to your computer and use it in GitHub Desktop.
## main file
<div id="eula_table_id">
<%= render :partial => "config/eula_list" %>
</div>
<div class="form-row">
<%= link_to_remote "Add new end user license agreement",
{ :update => "eula_table_id", # you may not need this :update parameter
:before => "$('#add-user-spinner').show();" +
"statusInfo('wait', 'adding a new user ...');",
:method => :post,
:position => "after",
:url => { :controller => :config,
:action => :add_eula,
:appliance_id => current_appliance.id} } %>
<img src="/images/spinner.gif" id="add-user-spinner" alt="">
</div>
## controller (config)
def add_eula
render :update do |page|
page.insert_html :bottom, 'eula_table_id', :partial => "config/eula_list"
end
end
## _eula_list.html.erb
<%= text_area :image, :eula_text, :rows => 20, :value => @image.eula_text %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment