Skip to content

Instantly share code, notes, and snippets.

<h1>Editing coupon</h1>
<%= form_for(@coupon, :html => {:multipart => true}) do |f| %>
<% if @coupon.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@coupon.errors.count, "error") %> prohibited this coupon from being saved:</h2>
<ul>
<% @coupon.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
@shruti28
shruti28 / gist:6020372
Last active December 19, 2015 21:29
can someone explain how the attributes of subclass be saved after it extends some superclass...The type in super class is getting saved bt no attribute is getting saved for subclass
class Party < ActiveRecord::Base
attr_accessible :dateCreated, :lastUpdate, :tempForUpdate, :type
end
>>>>>>>>>>
class Project < Party
attr_accessible :country, :department, :email, :firstName, :lastName, :location, :mobilePhone, :title
end
>>>>>>>>>>>>
class ProjectsController < ApplicationController
def save