I know this contradicts Ruby on rails conventions, but my identifier for this table does not require auto-increment and I set it through the logic. However, it is not stored in the database. All retrieved stored values ββare stored as null for the identifier.
def self.up create_table :probes, :id => false do |t| t.string :id t.string :name t.integer :user_id t.boolean :online t.timestamps end end <% form_for @probe do |f| %> <%= f.error_messages %> <p> <%= f.label "Site name" %><br /> <%= f.text_field :name %> </p> <p style="margin-left: 10%"> <%= f.label "Probe Key" %><br /> <%= f.text_field :id, :value => @token %> </p> <p style="margin-left: 20%"> <%= link_to "Back to List", probes_path %> <%= f.submit "Submit",:style => "margin-left: 75px;" %></p> <% end %>
Is it possible? Or is there somewhere besides the new.html.erb file that I have to change / check?
source share