Questions tagged [scaffold]

429 questions
0
votes
1 answer

has_one , belongs_to and create_before in rails

I create 2 model with scaffold: problem reporter I want create 1 reporter for each problem and use before_create for create reporter. I generate reporter_id by integer type in problems table in database. The below code show the problem and…
mgh
  • 921
  • 3
  • 9
  • 37
0
votes
1 answer

rails scaffold form, simplest way of adding a field?

Say I did rails g scaffold Review artist:string song:string genre:string and created a review object with those fields...would it later be possible to easily add another field like rating:int via a rails command, or would I need to manually edit all…
parameter
  • 894
  • 2
  • 18
  • 35
0
votes
2 answers

Replace rails scaffold stylesheet content

Hi i have made some custom template views for scaffold generators and put the…
JGutierrezC
  • 4,398
  • 5
  • 25
  • 42
0
votes
1 answer

Ruby on Rails: undefined method `user' for #

The code is below. User is the name in my database, but it is saying it is an undefined method when it should not be. It is just a string value in my database. I have looked at all the other posts about this error but their solutions did not work…
user2512888
  • 191
  • 1
  • 1
  • 12
0
votes
3 answers

why is rails telling me to run rake db:migrate?

Hello I am new to rails. I am working with an existing postgres db. I would like to create CRUD for all of the tables. I've started with: rails g scaffold firstTableName Then I start rails: rails s When I navigate to localhost:3000/firstTableName,…
ed_is_my_name
  • 601
  • 3
  • 9
  • 24
0
votes
2 answers

RoR: I can't figure out how to add a new record using two integers taken from a text_field

I've been trying to figure this out for over a day now - so hopefully someone can shed some light on this issue for me. I believe the issues stems from me creating my new model (Subjects) using generate model instead of scaffold. So I've been…
Ian Ellis
  • 541
  • 6
  • 19
0
votes
1 answer

model and controller different namespace , achieve scaffolding

Need some tips on how to achieve. Normally we would do this for scaffold: rails g scaffold User email:string password_hash:string password_salt:string (and exit) However, due to the complexity of what I want to achieve in mind, thus the…
Gavin Yap
  • 642
  • 12
  • 26
0
votes
1 answer

how to make scaffold template add new custom views

Scaffold MVC default genaration for default Views template as : _CreateOrEdit Edit Create Index Now I want to create Template like _CreateOrEdit Edit Create Index and new template _Index as subview in Index for PageListMVC Could you suggest to…
Yoko2012
  • 103
  • 6
0
votes
0 answers

Can't generate scaffold. Could not find rail ties gem load error

Ruby/Rails is so confusing. I'm going through the Michael Hartl tutorial, and I get an error with the following terminal command: $ rails generate scaffold Micropost content:string user_id:integer gives…
john
  • 123
  • 2
  • 12
0
votes
1 answer

Best Practices for Rails Scaffold method

I am new to rails framework. I am confused that what is the benefit of generating scaffold instead of creating tables and columns in DB manually.What is the best for creating rich relational databases in Rails? And can I do bit advance things using…
Zain Zafar
  • 1,607
  • 4
  • 14
  • 23
0
votes
2 answers

Rails Routing Error

Weird error. I'm a newby to rails. From a new install of rails I connected to an oracle db and then ran: jruby script/generate scaffold job oid:integer userid:integer name:string status:integer Without doing anything else I started up the server…
Ben Matz
  • 143
  • 1
  • 1
  • 5
0
votes
1 answer

Pins order shows up in reverse

I am working on a scaffold pins rails app. On the app there are three models, pins, users and categories. Initially the pins should show up with the earliest pins at the very bottom, and the latest ones at the very top. However, this order seems to…
Matthew W.
  • 261
  • 1
  • 4
  • 11
0
votes
0 answers

Rendering pins of categories to index

I am a newbie and I am working on a scaffold category for pins on a rails app. I have managed to assign a category to each new pin now, but how do I set it up so that when I go look at a certain specific category (ie. "cars"), it will automatically…
Matthew W.
  • 261
  • 1
  • 4
  • 11
0
votes
2 answers

Finding which contigs go into any given scaffold in an 454-Newbler assembly

I guess there should be a quite simple script for calling which contigs go into which scaffolds. This is 454 data assembled with Newbler. Thanks!
0
votes
1 answer

Extra space between attributes and types in sqlite using rails

I was using rails to create a sqlite table in my application, I tried an example from a tutorial which I typed the command: rails generate scaffold Product \ title:string description:text image_url:string price:decimal It worked and generated…