You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,30 +4,24 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
codebar planner is a Rails 7.2 application for managing [codebar.io](https://codebar.io) members and events. It handles workshop/event scheduling, member registration, invitations, RSVPs, and feedback collection for coding workshops organized by codebar chapters.
7
+
codebar planner is a Rails 8.1 application for managing [codebar.io](https://codebar.io) members and events. It handles workshop/event scheduling, member registration, invitations, RSVPs, and feedback collection for coding workshops organized by codebar chapters.
8
8
9
9
## Development Setup
10
10
11
-
### Docker (Recommended)
12
-
13
-
-**Initial setup**: `bin/dup` - builds container, sets up database with seed data
-**Tests**: `bundle exec rspec [path]` - runs RSpec tests, optionally for specific file/line
18
+
-**Rails console**: `bundle exec rails console`
19
+
-**Run rake tasks**: `bundle exec rake [task]`
20
+
-**Linting**: `bundle exec rubocop`
21
+
22
+
### Docker Setup (Not Used)
23
+
24
+
Docker setup exists in this repository (`bin/d*` commands) but is **not used** for development work with Claude Code.
31
25
32
26
### Environment Variables
33
27
@@ -149,6 +143,95 @@ Key RuboCop exclusions:
149
143
-`db/`, `spec/`, `config/`, `bin/` excluded from most cops
150
144
- Documentation not required (`Style/Documentation: false`)
151
145
146
+
## Parameter Handling
147
+
148
+
This application uses Rails 8.0 `params.expect` for parameter filtering and validation.
149
+
150
+
### Basic Pattern
151
+
152
+
Use `params.expect` instead of `params.require().permit()`:
153
+
154
+
```ruby
155
+
defresource_params
156
+
params.expect(resource: [
157
+
:field1, :field2, :field3
158
+
])
159
+
end
160
+
```
161
+
162
+
### Type Safety
163
+
164
+
Controllers using `params.expect` raise `ActionController::ParameterMissing` when:
165
+
- Parameter type is tampered (e.g., string sent instead of hash)
166
+
- Required parameters are missing
167
+
- Nested parameter structure is invalid
168
+
169
+
This makes parameter validation failures explicit and easier to handle at the application level.
170
+
171
+
### Nested Arrays
172
+
173
+
Use hash syntax for array parameters:
174
+
175
+
```ruby
176
+
params.expect(workshop: [
177
+
:name, :date,
178
+
{ sponsor_ids: [] }
179
+
])
180
+
```
181
+
182
+
### Nested Attributes
183
+
184
+
**IMPORTANT:**`params.expect` does NOT work with `accepts_nested_attributes_for`.
185
+
186
+
Rails forms with nested attributes send hash-with-numeric-keys like `{'0' => {...}, '1' => {...}}`, which params.expect cannot handle. For controllers using `accepts_nested_attributes_for`, continue using the old syntax:
0 commit comments