Note that there are some explanatory texts on larger screens.

plurals
  1. POform input not saving after submit
    text
    copied!<p>So, I let a friend work on my app today and now the :url, 'website url' portion of the form isn't saving but the rest is. Not sure why this is happening. I went in the console and had to .save manually for it to show in the browser. </p> <pre><code>&lt;div class="row"&gt; &lt;div class="large-6 columns"&gt; &lt;div class="field"&gt; &lt;%= f.label :title %&gt; &lt;%= f.text_field :title %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label 'website url' %&gt; &lt;%= f.text_area :url %&gt; &lt;----------- this field isn't saving anymore. &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :tag_list, "Genres (separated by commas)" %&gt;&lt;br /&gt; &lt;%= f.text_field :tag_list %&gt; &lt;/div&gt; &lt;p&gt; &lt;%= f.file_field :track%&gt; &lt;/p&gt; &lt;div class="actions"&gt; &lt;%= f.submit value: "Upload" %&gt; &lt;/div&gt; </code></pre> <p><strong>schema snippit</strong></p> <pre><code> create_table "songs", force: true do |t| t.string "title" t.string "artist" t.text "url" t.string "track_file_name" t.string "track_content_type" t.integer "track_file_size" t.datetime "track_updated_at" t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" t.integer "plusminus" end </code></pre> <p><strong>song_controller.rb</strong></p> <pre><code>class SongsController &lt; ApplicationController before_filter :authenticate_user!, only: [:create ,:edit, :update, :destroy, :vote_for_song] before_action :set_song, only: [:show, :edit, :update, :destroy, :vote_for_song] def vote_for @song = Song.find(params[:id]) current_user.vote_for(@song) @song.plusminus = @song.votes_for @song.save respond_to do |format| format.js { render 'update_votes' } end end def vote_against @song = Song.find(params[:id]) current_user.vote_against(@song) respond_to do |format| format.js { render 'update_votes' } end end def new_songs @songs = Song.order "id DESC" end # GET /Songs # GET /Songs.json def index if params[:genre] @songs = Song.tagged_with(params[:genre]).paginate(:page =&gt; params[:page], :per_page =&gt; 15) else @songs = Song.order('plusminus').paginate(:page =&gt; params[:page], :per_page =&gt; 15) end end # GET /Songs/1 # GET /Songs/1.json def show @comment = Comment.new(song: @song) end # GET /Songs/new def new @song = Song.new end # GET /Songs/1/edit def edit end # POST /Songs # POST /Songs.json def create @song = Song.new(song_params) respond_to do |format| if @song.save format.html { redirect_to @song, notice: 'Song was successfully created.' } format.json { render action: 'show', status: :created, location: @song } else format.html { render action: 'new' } format.json { render json: @song.errors, status: :unprocessable_entity } end end end # PATCH/PUT /Songs/1 # PATCH/PUT /Songs/1.json def update respond_to do |format| if @song.update(song_params) format.html { redirect_to @song, notice: 'Song was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @song.errors, status: :unprocessable_entity } end end end # Song /Songs/1 # Song /Songs/1.json def destroy @song.destroy respond_to do |format| format.html { redirect_to songs_url } format.json { head :no_content } end end private def set_song @song = Song.find(params[:id]) end def song_params params.require(:song).permit(:title, :artist, :bio, :track, :user_id, :tag_list) end end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload