Sha256: d6298e60c46b2f101f1248299e5ffa35f85bc8b8d6fc2cfdfe5ae8cca981a0ae
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
class RailsDetailMy::NotesController < RailsDetailMy::BaseController before_action :set_note def show end def edit end def update @note.assign_attributes note_params respond_to do |format| if @note.save format.html { redirect_to @content, notice: 'Picture was successfully updated.' } format.json { render :show, status: :ok, location: @content } format.js else format.html { render :edit } format.json { render json: @content.errors, status: :unprocessable_entity } end end end def destroy @content.destroy respond_to do |format| format.html { redirect_to pictures_url, notice: 'Picture was successfully destroyed.' } format.json { head :no_content } end end private def set_note @note = Note.find_or_initialize_by(detail_type: params[:detail_type], detail_id: params[:detail_id]) end def note_params params[:note].permit( :title, :body, :key, :type ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_detail-0.0.1 | app/controllers/rails_detail_my/notes_controller.rb |