title: Rails saving half of a post entry
body: <p>Afternoon all, </p>
  
  <p>I have a post model, which has a song name, song string fields and a user_id field. A user can create a new song with up to 10,000 characters. Now when saving a short song it displays it all just fine in its entirety, however when a user enters a long song say over 400 chars, it seems to cut most of it off displaying only about 200 chars, the same happens when editing, add the remains of the song and it still cuts it off. Database is Mysql and checking in the console, it doesn't seem to save the full entry either. The songs are written in keyboard format, e.g  E T W R[TREW] | WEER. Ive had a google and haven't found anything along these lines.</p>
  
  <p>my code is as follows;</p>
  
  <p>post.rb</p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
    attr_accessible :song, :song_name, :user_id, :rating
    has_many :comments, dependent: :destroy
    has_many :ratings, dependent: :destroy
    belongs_to :user
  
    before_save :rating
  
    validates_presence_of :user_id
    validates :song_name, presence: true, length: { maximum: 70 }
    validates :song, presence: true, length: { maximum: 10000 }
  
    default_scope order: "posts.created_at DESC" 
  </code></pre>
  
  <p>posts_controller.rb</p>
  
  <pre><code>def show
      @post = Post.find(params[:id])
      @comments = @post.comments
      @ratings = @post.ratings
      respond_to do |format|
        format.html 
        format.json { render json: @post }
      end
    end
  
  
    def new
      @post = Post.new
      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @post }
      end
    end
  
    def edit
      @post = Post.find(params[:id])
    end
  
    def create
      @post = current_user.posts.build(params[:post])
      respond_to do |format|
        if @post.save
          format.html { redirect_to @post, success: 'Post was successfully created.' }
          format.json { render json: @post, status: :created, location: @post }
        else
          format.html { render action: "new", error: "please sign in to post" }
          format.json { render json: @post.errors, status: :unprocessable_entity }
        end
      end
    end
  
    def update
      @post = Post.find(params[:id])
      respond_to do |format|
        if @post.update_attributes(params[:post])
          format.html { redirect_to @post, success: 'Post was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: "edit", error: "please try again" }
          format.json { render json: @post.errors, status: :unprocessable_entity }
        end
      end
    end
  </code></pre>
  
  <p>and the show.html.erb</p>
  
  <pre><code>&lt;div class="center hero-unit"&gt;
      &lt;h1&gt;&lt;%= @post.song_name %&gt;&lt;/h1&gt;
       &lt;p&gt;Transcript by: &lt;%= @post.user.name %&gt;&lt;br/&gt;
       Rating: &lt;%= @post.rating %&gt;/10&lt;/p&gt;
      &lt;br/&gt;
       &lt;p&gt;&lt;%= raw @post.song %&gt;&lt;/p&gt;
      &lt;br/&gt;
       &lt;span class="timestamp"&gt;
         updated &lt;%= time_ago_in_words(@post.updated_at) %&gt; ago.
      &lt;/span&gt;
         &lt;%= link_to 'Edit', edit_post_path(@post) %&gt;
      &lt;br/&gt;
         &lt;% if !signed_in %&gt;
           please login to rate songs
         &lt;% else %&gt;
           &lt;%= render partial: "ratings/form", locals: { post_id: @post.id }%&gt;
        &lt;% end %&gt;
     &lt;/div&gt;
  
  &lt;%= render partial: "comments/form", locals: { post_id: @post.id } %&gt;
  &lt;%= render partial: "comments/show", locals: { comments: @comments, post_id: @post.id } %&gt;
  </code></pre>
  
  <p>if anyone has any ideas it would be much appreciated, and if you need more code just ask. cheers Andy.</p>