Comments (1)
while it is true that you need to remove a level of the nesting, in this case, you would not want to use shallow nesting feature in rails
The reason is - nobody should ever have the opportunity to change a player ID nor will they have the opportunity to view other players from what I gather. so there's no need to have the player resource involved in any nesting at all
this can be achieved in a number of ways, but one example would be using rounds:
The route for rounds should be at the top level and not nested under anything so the URL should simply be
/rounds
in the controller index action:
@rounds = current_user.rounds
The point is, you never need to pass around player IDs because it's always current_user and you have this variable already available in every view and action
The only caveat here is if you want the app to work in a way where players can see other player scores - then the rails shallow nesting option would work well
On Nov 7, 2014, at 3:48 PM, Kerry [email protected] wrote:
Create action is getting too nested bc of nested resources (player/id/round/id/score/id)
Need to fix routes with:
a) shallow nesting: http://nithinbekal.com/posts/rails-shallow-nesting/
b) replacing player w/ current_user
—
Reply to this email directly or view it on GitHub.
from golf_keeper.
Related Issues (20)
- Player Creation Bug: The action 'index' could not be found for PlayersController
- Update the Player Edit form so that entering a password isn't required HOT 1
- current_user = player HOT 2
- Player Show Page HOT 1
- Nested Resource Forms HOT 1
- Blank Course in the New Round Form
- Does Yardages model need to correspond to a holes_number field? HOT 1
- Round Show View HOT 3
- To Do: Soft Delete for Player
- Scheduler To-Do List
- Populating Dropdown Menu w/o a Resource
- Create # of holes based on course_length attribute
- New Match Form End Date Field
- How to add players to a match / player_match model?
- Creating a scorecard for player_match's scores
- What's with the extra branch?
- Player Signout from Navigation Bug
- Navigation bar routing/rendering bug HOT 3
- InvalidHash in SessionsController
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from golf_keeper.