Comments (1)
Jak najbardziej możesz przekazywać kontrolerem inne modele. W kodzie, który wrzuciłeś kontroler przekaże wszystkie obiekty PlaylistTrack
w zmiennej @playlist_track
, ale po odpaleniu akcji TracksController#playlist_tracks
i do odpowiedniego widoku (tutaj domyślnie byłby to widok w pliku app/views/tracks/playlist_tracks.html.erb
).
Przykładowo:
class FoosController < ApplicationController
def index
@foo = Foo.all
@bar = Bar.all
end
end
from ror4beginners2018.
Related Issues (12)
- Materiały z zajęć HOT 1
- attr_reader, attr_writer i attr_accessor
- dziedziczenie i metody
- Zad3 bestiary_controller directory wrong name HOT 2
- instalacja rails pod windows 10 HOT 5
- Udostępnianie rozwiązań? HOT 3
- Zadanie 3 prośba o bliższą interpretacje polecenia HOT 1
- FootballPlayerManager jest niewidoczny HOT 3
- Problem z tworzeniem instancji modelu HOT 1
- Literówka powodująca ActiveRecord::HasManyThroughAssociationNotFoundError HOT 1
- Zły artist input przy wysłaniu formularza z błędem walidacji HOT 1
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 ror4beginners2018.