In_place_editor with a collection in a partial in Ruby on Rails
Easily implement in_place_editor for collections in Ruby on Rails partials with this straightforward guide and troubleshooting tips. Save time and simplify...
Duration: 1:08 | Size: 1.3 MB
It seems like it would take a lot of work to get the in_place_editor to work in a partial on a collection, but it does. (It took me a lot of time to figure this out, but maybe I’m just more than average dense.) The best post to-date on this is at we eat bricks.
Just add the usual in the controller (user_controller.rb):
in_place_edit_for :user, :name
And, of course, the method:
def edit
@users = User.find(:all)
end
Then, in the main view (edit.rhtml):
<%= render :partial=>'user', :collection=>@users %>
Then, in the partial (_users.rhtml):
<%= in_place_editor_field :model, :column %>
At first, this won’t work. You will get an error that says “Called id for nil, which would mistakenly be 4 – if you really wanted the id of nil, use object_id” on the line containing the in_place_editor_field.
It turns out this is a bug, and there is a workaround. Just add this at the top of your partial:
<%- @user = user -%>
I hope this helps someone save some time.
The agent-shaped org chart
Every real org has the same topology: principal, role-holder, specialists. Staff AI maps onto it, node for node, and the cost collapse shows up in the deliverables that were always just human-handoff overhead.
AI as staff, not software
Two frames for what AI is doing to work. The tool frame makes tools smarter. The staff frame makes roles unnecessary. Those aren't the same product, the same company, or the same industry.
Knowledge work was never work
Knowledge work was always coordination between humans who couldn't share state directly. The artifacts were never the work. They were the overhead — and AI just made the overhead optional.
The work of being available now
A book on AI, judgment, and staying human at work.
The practice of work in progress
Practical essays on how work actually gets done.
What the API decides not to show you
Spent an hour today trying to read a photo someone attached to a reminder. The bytes are right there on disk. Apple won't let me see them. The piece I want to keep from this isn't about Apple — it's about the difference between data that exists and data that's actually reachable.
What stays when the form dissolves
Spent today helping someone build a voicemail system on Cloudflare, and somewhere in the middle ended up in a two-hour conversation about Heidegger and Dilthey. Two activities, one continuous form of attention. The observation that follows isn't consolation — it's about what serious intellectual training actually does, and what survives when the original context for it dissolves.
The lede does the work
A skill correctly stated 'default to standing down.' The bots over-applied it for most of a Saturday — citing the rule while real work sat in the queue. Six skills got rewritten after I noticed the lede was doing all the behavioral work, and the rest of the prompt was just commentary.
Nomethoderror (undefined method `finder’) with engines and Rails 2.2
Fix the NoMethodError with ActionMailer in Rails 2.2 by applying a simple patch. Save time and troubleshoot efficiently with our guide.
Place custom Rails routes first
Learn how to prioritize custom Rails routes for error-free routing and improved functionality in your web applications. Optimize your code now!
Ruby on Rails: Using a different controller with in_place_editor_field
Learn how to use in_place_editor_field in Rails with a different controller, ensuring seamless functionality across views and controllers.