Questions tagged [scaffold]
429 questions
0
votes
2 answers
undefined method current_user: Cancan and Active Scaffold
I'm trying to add an action link to an active scaffold controller using
if current_user.can? :update, Post
config.action_links.add 'export', :label => 'Export', :page => true
end
but whatever controller I try to use, I always get undefined method…

pasine
- 11,311
- 10
- 49
- 81
0
votes
3 answers
Ruby on Rails - Count Entries on Scaffold
In a simple Ruby on Rails applicaiton, I have a Scaffold called "Proposals" on which one of its columns is a string called "creationyear". I'm trying to count how many proposals have been created each year when the index page is loaded doing the…

Francisco Lamas
- 3
- 2
0
votes
1 answer
How can I pass data from one scaffold to another?
I'm currently creating a website where one can read several mangas. The structure is as follow (and as asked by the people I'm working for): First of all, you have all the manga titles (let's say, Naruto, One Piece, One Punch, etc). Then, when you…

Jaeger
- 1,686
- 1
- 30
- 50
0
votes
1 answer
Connect student_id to submission_id in Rails
I was trying to connect my student_id to the submission_id, but it's not working. I have a join table which is called submissionstudent.
Student Controller.rb:
class StudentsController < ApplicationController
before_action :set_student, only:…

Giovanni Pecchio
- 13
- 1
- 2
- 8
0
votes
2 answers
Why can't I get /comments/new.html.erb?
I created models by scaffold command
class Post < ActiveRecord::Base
has_many :comments, as: :commentable
end
class Comment < ActiveRecord::Base
belongs_to :commentable , polymorphic: true
end
...
routes.rb:
resources :posts, :images, :links…

Vladimir
- 67
- 5
0
votes
1 answer
Rails scaffold parameter non permitted
I have a Ruby on Rails application with some generated scaffold.
Now, in one of them I need to add a parameter that wasn't planned initially.
The situation is that I have two objects: Block and Keywords. The relationship between them is…

ste
- 3,087
- 5
- 38
- 73
0
votes
1 answer
" undefined method `enumerable_enumerator_path' " error
I'm using basic scaffold structure. What I need, is to add 'moderate' action and view by changing published to true. In my idea, on moderate.html I should get the list of all unpublished entries with the ability to change and save their…

Maay
- 575
- 9
- 27
0
votes
2 answers
Rails link_to Last Scaffold Item
I'm working on a learning platform that at this stage has users, an admin, and 'feeds' (pages with learning content). I would like to create a link that would take users to the newest feed created by the admin. In the console, I could locate this…

ThaddeusM
- 3
- 2
0
votes
3 answers
Rails Modify Scaffold Form
Using rails 5.0.0 for building a simple timecard module for a web application. My question is how do I go about modifying a form which is automatically being rendered by rails scaffold
rails g scaffold Timesheet user:string clock:string…

Dango
- 149
- 2
- 14
0
votes
1 answer
Why generate scaffold won't work?
I'm currently following Rails tutorial by Michael Hartl here.
To proceed with my application I did the following(as the book said):
rails generate scaffold User name:string email:string
However I'm getting the following errors:
user6276737
0
votes
0 answers
scaffold, belongs_to :user doesn't work
I just generated a scaffold. I added has_many :posts to the user.rb and added belongs_to :user to the post.rb. But now when i try to create a new post it tells me that an error occurred and that *user must exist?
Anyone know how to solve this?
0
votes
1 answer
nested_scaffold URLGenerationError
My error says:
No route matches {:action=>"new", :advertiser_id=>"2",
:controller=>"analyses", :experiment_id=>nil} missing required keys:
[:experiment_id]
Error happens in
app/views/analyses/index.html.erb:29:in
…

Leo LeGendre
- 63
- 2
- 10
0
votes
1 answer
What scaffold and models i need to cr8 RnR app?
I've got some database in .yml format and i don't understand what's scaffold and models i need to cr8 for this app.
.yml file:
users:
- group: 'Admin'
todo_list:
- text: 'Create new user group'
isCompleted: false
- group: 'Moderator'
…

Nikolay Vetrov
- 624
- 6
- 17
0
votes
1 answer
How to do Rails CRUD without scaffolding command
In Gem:
gem 'simple_form', '~> 3.2', '>= 3.2.1'
gem 'haml', '~> 4.0', '>= 4.0.7'
In Model:
ActiveRecord::Schema.define(version: 20160706040748) do
create_table "jobs", force: :cascade do |t|
t.string "title"
t.text "description"
…

Osp
- 126
- 7
0
votes
2 answers
What does scaffold mean in this context?
A generator is basically a plugin that can be run with the yo command to >scaffold complete projects or useful parts.
It can be found under the "What's Yeoman?" section here: yeoman.io

PudparK
- 111
- 2
- 13