Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--This line shows nothing. Returns nil all the time even though the cell is not empty -->
- <% @resume.extra.interests %>
- class Resume < ActiveRecord::Base
- has_one :extra
- accepts_nested_attributes_for :extra
- end
- class Webconnection < ActiveRecord::Base
- belongs_to :resume
- end
- class ResumesController < ApplicationController
- def show
- @resume = Resume.find(params[:id])
- end
- def new
- @title = "Create a new resume"
- @resume = Resume.new
- experience = @resume.experiences.build
- education = @resume.educations.build
- extra = @resume.build_extra
- webconnection = @resume.build_webconnection
- end
- def create
- @resume = Resume.new(params[:resume])
- if @resume.save
- #UserMailer.created_resume_email(@user).deliver
- redirect_to @resume
- else
- @title = "Create a new resume"
- render :action => "new"
- end
- end
- end
- class CreateExtras < ActiveRecord::Migration
- def change
- create_table :extras do |t|
- t.text :interests
- t.text :recommendations
- t.text :awards
- t.text :activities
- t.integer :resume_id
- t.timestamps
- end
- end
- end
- <% @resume.extra.interests %>
- <%= @resume.extra.interests %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement