Skip to content
Edit in place plugin for jRails.
Find file
Failed to load latest commit information.
javascripts first commit
lib The helper with instance of ActiveRecord
tasks first commit
test Update README and create tests
MIT-LICENSE first commit
README update
Rakefile first commit
init.rb update
install.rb first commit
uninstall.rb first commit



Edit in place for jRails.

  # Controller
    class BlogController < ApplicationController
      in_place_edit_for :post, :title

  # Customize the action that update the value
  class BlogController < ApplicationController
    # set_#{object}_#{title}
    def set_post_title
      post = Post.find(params[:id]) 
      post.title = params[:value] # Name of parameter is always 'value'.

      # It should render a text 
      render :text => post.title
  # View
  <%= in_place_editor_field :post, :title %>

  # Pass some options
  <%= in_place_editor_field :post, :title, {}, {:field_type => 'textarea', :textarea_cols => 25, :textarea_rows => 10}%>
  <%= in_place_editor_field :post, :title, {}, {:field_type => 'textarea', :textarea_rows => 10}%>
For more details, see comments in jrails_in_place_macros.rb.

Dual Licenses
This plugin uses implementaion of in-place editor for jQuery, created by Rakuto Furutani
Implementation of in-place editor for jQuery that created by David Hauenstein is used.
Thank you.

Copyright (c) 2008 Rakuto Furutani, released under the MIT license
Something went wrong with that request. Please try again.