Ruby on Rails routes - ruby-on-rails

Hello i am a new in ROR and i have a problem with routing. My route is that
http://localhost:3000/keys/pass.9 and i want to be like http://localhost:3000/keys/9/pass
Look my routes :
resources :keys , only: [:new, :show, :create, :edit, :update, :index] do
collection do
delete 'destroy_multiple'
get 'pass'
end
end
the controller:
class KeysController < ApplicationController
def pass
Key.find(params[:id]).update_attribute(:passwrod,SecureRandom.urlsafe_base64 )
respond_to do |format|
format.html { redirect_to books_path }
format.json { head :no_content }
flash[:success] = "Profile updated"
end
end
and the view:
<div class="center hero-unit">
<h1>Listing keys</h1>
<%= form_tag destroy_multiple_keys_path, method: :delete do %>
<table>
<thead>
<tr>
<th></th>
<th>Url</th>
<th>Username</th>
<th>Passwrod</th>
<th>Category</th>
</tr>
</thead>
<tbody>
<div>
<% for key in #keys %>
<% if key.book.name == #book %>
<tr>
<td><%= check_box_tag "key_ids[]", key.id %></td>
<td><%=key.url %></td>
<td><%=key.username %></td>
<td><%=key.passwrod %></td>
<td><%=key.category %></td>
<td><%= link_to 'Edit',edit_key_path(key) %></td>
<td> <%= link_to 'Change password', pass_keys_path(key) %> </td>
</tr>
<% end %>
<% end %>
<tr>
<td> <input type="button" value="check all" onclick="$(this.form).getInputs('checkbox').each(function (elem) {elem.checked = true;});" /> </td>
</tr>
</div>
<%= submit_tag "Delete selected" %>
<% end %>
<%= link_to 'New Key', new_key_path %>
<%= link_to 'Back', books_path %>
</div>
and i get that error now :
Couldn't find Key without an ID

Change the routes as
resources :keys , only: [:new, :show, :create, :edit, :update, :index] do
collection do
delete 'destroy_multiple'
end
member do
get 'pass'
end
end

Related

Couldn't find Category without an ID for Rails Blog

I'm experiencing some problems while trying to create categories for my Blog.
ActiveRecord::RecordNotFound in ArticlesController#index
This is the routes.rb file code
Rails.application.routes.draw do
resources :categories
# get 'sessions/new'
resources :sessions
resources :users
get 'welcome/index'
resources :articles do
resources :comments
collection do
get :search #creates a new path for searching
end
end
resources :subscribers
root 'welcome#index'
get 'pages/about' => 'application#show'
end
This is the articles_controller.rb file code
class ArticlesController < ApplicationController
before_action :admin_authorize, :except => [:index, :show, :search]
def index
if params[:category].blank?
#articles = Article.all.order("created_at DESC")
else
#category_id = Category.find_by(name: params[:category]).id
#articles = Article.where(category_id: #category_id).order("created_at DESC")
end
end
def new
#article = Article.new
#categories = Category.all.map{|c| [c.name, c.id]}
end
def show
#article = Article.find(params[:id])
end
def create
#article = Article.new(article_params)
#article.category_id = params[:category_id]
respond_to do |format|
if #article.save
format.html { redirect_to #article, notice: "Article was successfully created!" }
format.json { render :show, status: :created, location: #article }
else
format.html { render :new}
format.json {render json: #article.errors, status: :unprocessable_entity}
end
end
end
def edit
#article = Article.find(params[:id])
#categories = Category.all.map{|c| [ c.name, c.id ] }
end
def search
if params[:search].blank?
#articles = Article.all
else
#articles = Article.search(params)
end
end
def update
#article = Article.find(params[:id])
#article.category_id = params[:category_id]
if #article.update(article_params)
redirect_to #article
else
render 'edit'
end
end
def destroy
#article = Article.find(params[:id])
#article.destroy
redirect_to articles_path
end
private
def article_params
params.require(:article).permit(:title, :text, :search, :music, :movie, :photo)
end
def find_article
#article = Article.find(params[:id])
end
end
And here is article index view file: (where error is)
<div class="row">
<div class="col"></div>
<div class="col-md-10">
<h1>List of all Articles</h1>
<% if current_user && current_user.admin? %>
<p>
<%= link_to 'Create New Article', new_article_path, class:'btn btn-lg btn-info' %>
</p>
<% end %>
<table class="table table-hover table-striped table-responsive-xs">
<thead>
<tr>
<th>Photo</th>
<th>Date</th>
<th>Title</th>
<th>Text</th>
<% if current_user && current_user.admin? %>
<th colspan="3">Editing Options</th>
<% else %>
<th colspan="1">Show Articles</th>
<%end%>
</tr>
</thead>
<tbody>
<% #articles.each do |article| %>
<tr>
<td>
<% if article.photo.present? %>
<%= image_tag article.photo.url(:thumb) %>
<% else %>
<%= image_tag('noimage.jpg', style:"width:50px;") %>
<% end %>
</td>
<td>
<%= article.created_at.strftime('%d/%m/%Y')%>
</td>
<td>
<%= article.title %>
</td>
<td>
<%= truncate(article.text, length: 75) %>
</td>
<td>
<%= link_to Category.find(article.category_id).name, category_path(article.category_id) %>
</td>
<td>
<%= link_to 'Show', article_path(article), class:'btn btn-sm btn-info' %>
</td>
<% if current_user && current_user.admin? %>
<td>
<%= link_to 'Edit', edit_article_path(article), class:'btn btn-sm btn-warning' %>
</td>
<td>
<%= link_to 'Delete', article_path(article),
class: 'btn btn-sm btn-danger',
method: :Delete,
data: {confirm: "Are you sure???"}%>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<p>
<%= link_to 'Home', welcome_index_path, class:'btn btn-md btn-warning' %>
</p>
</div>
<div class="col"></div>
</div>
On my browser window I see that problem in this piece of 'article index view' view code:
<% #articles.each do |article| %>
and
<%= link_to Category.find(article.category_id).name, category_path(article.category_id) %>
You have a pretty much a textbook N+1 query issue, plus that article.category is optional so that you are calling Category.find(nil).name.
Provided that you have setup a 1-to-many association between Article and Category
class Category
has_many :articles
end
class Article
belongs_to :category
end
You should first of make sure that you are loading the category together with the articles:
class ArticlesController < ApplicationController
def index
#articles = Article.includes(:category).order(created_at: :desc)
end
end
Then when you iterate through the view just use article.category.
<% if article.category %>
<%= link_to article.category.name, article.category %>
<% end %>
You don't need to explicitly pass category_path(article.category_id). Just pass the record and Rails is smart enough to figure it out on its own.
I would also setup a separate controller to handle articles nested in a category:
# config/routes.rb
resources :categories do
resources :articles, only: [:index], module: :categories
end
# app/controllers/categories/articles_controller.rb
module Categories
class ArticlesController
before_action :set_category
# GET /categories/:category_id/articles
def index
#articles = #category.articles.order(created_at: :desc)
end
def set_category
#category = Category.includes(:articles).find(params[:category_id])
end
end
end
It has a lower cyclic complexity and adheres to the SRP. The fact that the controllers render a different view is also a plus as it lets you setup the view for different contexts. Use partials to share code if needed.
You can link to it with:
<%= link_to "Articles in #{category.name}", [category, :articles] %>

Rails: Add Mongoid Document to Temp Store for use in File Export Table

I am attempting to allow a user to pick rows from a table and add each record to an "export list". This export list is another table which displays the records selected by the user. There is then an option to export to a file..
I am stuck on getting the user selected document ID and displaying it in a separate table.
I have this setup:
Routes:
Rails.application.routes.draw do
resources :scenarios do
collection do
get :call_copy
get :export
end
end
end
Scenarios Controller:
class ScenariosController < ApplicationController
before_action :set_scenario, only: [:show, :edit, :update, :destroy]
before_action :all_scenarios, only: [:index, :create, :update]
respond_to :html, :js
...
def index
#scenarios = if params[:submitter].blank? && params[:application].blank? && params[:pillar].blank? && params[:test_type].blank? && params[:begin_date].blank? && params[:end_date].blank? && params[:search_text].blank?
Scenario.all.order_by(created_at: :desc)
else
Scenario.search_text(params)
end
respond_to do |format|
format.html
format.js
end
end
...
def export
#scenario = Scenario.find(params[:id])
#export_scenarios ||= []
#export_scenarios << #scenario
respond_to do |format|
format.html
format.js
end
end
...
end
Index.js.erb:
$('#export_class').html("<%= j (render 'export', export_scenarios: #export_scenarios) %>")
Index.html.erb:
<Table>
...
<li><%= link_to 'Export', export_scenarios_path(id: scenario), remote: true %></li>
...
</table>
<div id="export_class">
<%= render 'export', export_scenarios: #export_scenarios %>
</div>
_Export.js.erb:
$('#export_class').html("<%= j (render 'export', export_scenarios: #export_scenarios) %>")
_Export.html.erb:
<table class="table table-striped" style="max-height: 800px; overflow: scroll;">
<thead>
<tr>
<th>Scenario Name</th>
<th>Scenario Body</th>
<th>Options</th>
<th colspan="8"></th>
</tr>
</thead>
<tbody>
<% export_scenarios.each do |scenario| %>
<tr>
<td class="text-left"><%= scenario.scenario_name %></td>
<td class="text-left"><%= scenario.scenario_body %></td>
<td>
<button class="btn btn-danger dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
<i class="fa fa-times"></i>
</button>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= submit_tag "Export!", type: "submit", class: "btn btn-primary pull-right", :name => nil %>
Try passing the scenarios with:
render partial: 'export', locals: {export_scenarios: #export_scenarios}
Note the locals key (EDIT: and the partial).

Rails: Search bar isn't working

I'm trying to add a search bar for a database website I created, I found a tutorial and I "think" I did it correct.
When I do a search, such as "Judy Zhang", nothing shows up, even though it is in the database
my vendor.rb/concerns/models/app file
class Vendor < ApplicationRecord
has_many :fotos
def self.search(search)
if search
Vendor.where('lower(contact_name) LIKE ?', "'%#{search.downcase}%'")
else
Vendor.all
end
end
end
I believe I didn't do the coding right. Very new to ruby on rails. What did I do wrong here?
code for index.html.erb/vendors/views/layouts/app
<body>
<div class = "head">
<h1>Vendors </h1>
<div class = "image1" >
<img src= "http://dx.deucex.com/i/logo.png" >
</div>
</div>
</body>
<table>
<tr>
<%= button_to "New Vendor", new_vendor_path, :method => "get" %>
<%= button_to "Inventory", inventories_path, :method => "get" %>
<%= form_tag vendors_path, :method => 'get' do %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
<% end %>
</tr>
</table>
<table>
<tr>
<th>Company</th>
<th>Contact Name</th>
<th>Phone</th>
<th>Email</th>
</tr>
<% for vendor in #vendors %>
<tr>
<td><%= vendor.company %></td>
<td><%= vendor.contact_name %></td>
<td><%= vendor.phone %></td>
<td><%= vendor.email %></td>
<body>
<div class = "button1" >
<td><%= button_to "Show", vendor_path(vendor), :method => "get" %></td>
</div>
</body>
<td><%= button_to "Edit", edit_vendor_path(vendor), :method => "get" %></td>
<div class = "button3">
<td><%= button_to 'Delete',
vendor_path(vendor),
method: :delete,
data: { confirm: 'Are you sure?'} %></td>
</div>
</tr>
<% end %>
</table>
code for my VendorsController.rb/concerns/controller/app
class VendorsController < ApplicationController
def index
#vendors = Vendor.search(params[:search])
end
def show
#vendor = Vendor.find(params[:id])
end
def new
#vendor = Vendor.new
end
def create
#vendor = Vendor.new(vendor_params)
if #vendor.save
redirect_to #vendor
else
render 'new'
end
end
def edit
#vendor = Vendor.find(params[:id])
end
def update
#vendor = Vendor.find(params[:id])
if #vendor.update (vendor_params)
redirect_to #vendor
else
render 'edit'
end
end
def destroy
#vendor = Vendor.find(params[:id])
#vendor.destroy
redirect_to vendors_path
end
end
private
def vendor_params
params.require(:vendor).permit(:company, :contact_name, :phone, :email, :moq, :cost_per_item, :payment_method, :terms, :turnover, :returns, :notes)
end
Try changing the code in Vendor to
class Vendor < ApplicationRecord
has_many :fotos
def self.search(search)
if search
Vendor.where('lower(name) LIKE ?', "'%#{search.downcase}%'")
else
Vendor.all
end
end
end
My search bar isn't showing up
You should change the following
<% form_tag vendors_path, :method => 'get' do %>
to
<%= form_tag vendors_path, :method => 'get' do %>
# Notice that <%= %> evaluates and prints the output

Rails Generates Blank Record Even Input Data

I am learning to use CRUD, and setup a page to add a record, however it only generated blank record? Can you take a look my code?
thanks!
here is the Page controller:
class PagesController < ApplicationController
def index
#test = Page.all
end
def new
#test = Page.new
end
def create
#test = Page.new(params.permit(:subject_id,:name,:position,:visible,:permalink))
if #test.save
flash[:notice] = "Page created successfully!"
redirect_to(:action => 'index')
else
render('new')
end
end
end
here is the new.html.erb
<%= link_to("<< Back to List", {:action => 'index'}, :class => 'back-link') %>
<div class="pages new">
<h2>Create Subject</h2>
<%= form_for(:Page, :url => {:action => 'create'}) do |f| %>
<table summary="Page form fields">
<tr>
<th>Subject_ID</th>
<td><%= f.text_field(:subject_id) %></td>
</tr>
<tr>
<th>Name</th>
<td><%= f.text_field(:name) %></td>
</tr>
<tr>
<th>Position</th>
<td><%= f.text_field(:position) %></td>
</tr>
<tr>
<th>Visible</th>
<td><%= f.text_field(:visible) %></td>
</tr>
<tr>
<th>Permalink</th>
<td><%= f.text_field(:permalink) %></td>
</tr>
</table>
<div class="form-buttons">
<%= submit_tag("Create Subject") %>
</div>
<% end %>
</div>
Here is index.html.erb
<div class="pages index">
<h2>Pages</h2>
# <%= link_to("Add New Page", {:action => 'new'}, :class => 'action new') %>
<table class="listing" summary="Page list">
<tr class="header">
<th>Position</th>
<th>Page Name</th>
<th>Visible</th>
<th>Pages</th>
<th>Actions</th>
</tr>
<% #test.each do |f| %>
<tr>
<td><%= f.position %></td>
<td><%= f.name %></td>
<td class="center"><%= f.visible %></td>
<td class="center"><%= f.permalink %></td>
<td class="actions">
<%= link_to("Show", {:action => 'show', :id => f.id}, :class => 'action show') %>
<%= link_to("Edit", {:action => 'edit', :id => f.id}, :class => 'action edit') %>
<%= link_to("Delete", {:action => 'delete', :id => f.id}, :class => 'action delete') %>
</td>
</tr>
<% end %>
</table>
</div>
Thanks so much!
Strong parameters
Rails sends form parameters in nested hashes.
{ page: { subject_id: 1, name: 'Hello World.' } }
So to whitelist the parameters you would do.
class PagesController < ApplicationController
def index
#test = Page.all
end
def new
#test = Page.new
end
def create
#test = Page.new(page_params)
if #test.save
flash[:notice] = "Page created successfully!"
redirect_to(:action => 'index')
else
render('new')
end
end
private
def page_parameters
params.require(:page)
.permit(:subject_id,:name,:position,:visible,:permalink)
end
end
which is like doing:
params[:page].slice(:subject_id,:name,:position,:visible,:permalink)
form_for and models
Also your form should read:
<%= form_for(:page, :url => {:action => 'create'}) do |f| %>
Or:
<%= form_for(#page, :url => {:action => 'create'}) do |f| %>
:Page will give you the wrong key in your parameters and prevent rails from binding the form to your #page object. (The values posted will disappear from the form when it's invalid).

Ruby on Rails Submit button not working

I the look and feel of my new form for a new Opportunity (put in some tables, css, etc...) and now my "submit" button won't work. It doesn't create a new record nor does it perform any of the validation callbacks... I was wondering if anyone could help me? Here is the output from the terminal:
Started GET
"/opportunities/new?utf8=%E2%9C%93&authenticity_token=e31DA70sbl%2B3%2FJCeoTcxCTWncLcVs6R6FvR0ZU6vSmA%3D&opportunity%5Bdepartment%5D=DHS&opportunity%5Bagency%5D=asdf&opportunity%5Bprogram_name%5D=fdas&opportunity%5Bstage%5D=Assessment&opportunity%5Bcapture_manager%5D=Sherry+Hwang&opportunity%5Bprogram_description%5D=asdfadsf&opportunity%5Bnew_or_recompete%5D=Re-Compete&opportunity%5Bincumbent%5D=Adsf&opportunity%5Bcurent_contract_vehicle%5D=fdas&opportunity%5Bnew_contract_vehicle%5D=fdas&opportunity%5Bsb_set_aside%5D=Yes&opportunity%5Bprime_or_sub%5D=Prime&opportunity%5Bnaics%5D=234&opportunity%5Brfi_date%281i%29%5D=&opportunity%5Brfi_date%282i%29%5D=&opportunity%5Brfi_date%283i%29%5D=&opportunity%5Brfi_submitted%5D=&opportunity%5Best_rfp_date%281i%29%5D=&opportunity%5Best_rfp_date%282i%29%5D=&opportunity%5Best_rfp_date%283i%29%5D=&opportunity%5Best_full_value%5D=fdsa&opportunity%5Best_workshare%5D=asdf&opportunity%5Bp_win%5D=asdf&opportunity%5Bgovwin_id%5D=adsf&commit=Create+Opportunity"
for 127.0.0.1 at 2014-07-02 10:10:16 -0400
Processing by OpportunitiesController#new as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"e31DA70sbl+3/JCeoTcxCTWncLcVs6R6FvR0ZU6vSmA=",
"opportunity"=>{"department"=>"DHS", "agency"=>"asdf",
"program_name"=>"fdas", "stage"=>"Assessment",
"capture_manager"=>"Sherry Hwang", "program_description"=>"asdfadsf",
"new_or_recompete"=>"Re-Compete", "incumbent"=>"Adsf",
"curent_contract_vehicle"=>"fdas", "new_contract_vehicle"=>"fdas",
"sb_set_aside"=>"Yes", "prime_or_sub"=>"Prime", "naics"=>"234",
"rfi_date(1i)"=>"", "rfi_date(2i)"=>"", "rfi_date(3i)"=>"",
"rfi_submitted"=>"", "est_rfp_date(1i)"=>"", "est_rfp_date(2i)"=>"",
"est_rfp_date(3i)"=>"", "est_full_value"=>"fdsa",
"est_workshare"=>"asdf", "p_win"=>"asdf", "govwin_id"=>"adsf"},
"commit"=>"Create Opportunity"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 9]]
User Load (0.2ms) SELECT "users".* FROM "users"
Rendered opportunities/_form.html.erb (7.4ms)
Rendered opportunities/new.html.erb within layouts/application (8.1ms)
Completed 200 OK in 53ms (Views: 49.9ms | ActiveRecord: 0.4ms)
And here is my Opportunity controller:
class OpportunitiesController < ApplicationController
before_action :set_opportunity, only: [:show, :edit, :update, :destroy]
before_action :authenticate
helper_method :sort_column, :sort_direction
def index
#opportunities = Opportunity.where.not(stage: 'Retired').order(sort_column + " " + sort_direction)
respond_to do |format|
format.html
format.csv {send_data #opportunities.to_csv}
#format.xls {send_data #opportunities.to_csv(col_sep: "\t")}
end
end
def show
#opportunity = Opportunity.find(params[:id])
#render json: #opportunity
end
def new
#opportunity = Opportunity.new
end
def edit
end
def create
#opportunity = Opportunity.new(opportunity_params)
#opportunity.created_by = current_user.full_name
respond_to do |format|
if #opportunity.save
#opportunity.created_by = current_user.full_name
format.html { redirect_to #opportunity, notice: 'Opportunity was successfully created.' }
format.json { render :show, status: :created, location: #opportunity }
else
format.html { render :new }
format.json { render json: #opportunity.errors, status: :unprocessable_entity }
end
end
end
def update
respond_to do |format|
if #opportunity.update(opportunity_params)
format.html { redirect_to #opportunity, notice: 'Opportunity was successfully updated.' }
format.json { render :show, status: :ok, location: #opportunity }
else
format.html { render :edit }
format.json { render json: #opportunity.errors, status: :unprocessable_entity }
end
end
end
def destroy
#opportunity.destroy
respond_to do |format|
format.html { redirect_to opportunities_url, notice: 'Opportunity was successfully destroyed.' }
format.json { head :no_content }
end
end
private
def set_opportunity
#opportunity = Opportunity.find(params[:id])
end
def opportunity_params
params.require(:opportunity).permit(:department, :created_by, :capture_manager, :stage, :agency, :program_name, :program_description, :new_or_recompete, :incumbent, :curent_contract_vehicle, :new_contract_vehicle, :sb_set_aside, :prime_or_sub, :naics, :rfi_date, :rfi_submitted, :est_rfp_date, :est_full_value, :est_workshare, :p_win, :derated_sales, :govwin_id)
end
private
def sort_column
Opportunity.column_names.include?(params[:sort]) ? params[:sort] : "department"
end
def sort_direction
%w[asc desc].include?(params[:direction]) ? params[:direction]: "asc"
end
end
My view:
<%= form_for(#opportunity) do |f| %>
<% if #opportunity.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(#opportunity.errors.count, "error") %> prohibited this opportunity from being saved:</h2>
<ul>
<% #opportunity.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<table id="new_opp_form" style="width: 450px; background-color: white; border-style: none; border:1px orange;">
<tr style="background-color: white">
<td>Agency</td>
<td><%= f.text_field :agency %></td>
</tr>
<tr style="background-color: white">
<td>Program Name</td>
<td><%= f.text_field :program_name %></td>
</tr>
<tr style="background-color: white">
<td>Stage</td>
<td><%= f.select :stage, [[],['Assessment', 'Assessment'], ['Pre-Proposal', 'Pre-Proposal'], ['Proposal', 'Proposal'], ['Subitted', 'Submitted'],['Retired', 'Retired']] %></td>
</tr>
<tr style="background-color: white">
<td>Capture Manager</td>
<td><%= f.collection_select(:capture_manager, User.all, :full_name,:full_name,{:prompt => true}) %></td>
</tr>
<tr style="background-color: white">
<td>Program Description</td>
<td><%= f.text_area :program_description %></td>
</tr>
<tr style="background-color: white">
<td>New or Re-recompete</td>
<td><%= f.select :new_or_recompete, [[],['New', 'New'], ['Re-Compete', 'Re-Compete']] %></td>
</tr>
<tr style="background-color: white">
<td>Incumbent</td>
<td><%= f.text_field :incumbent %></td>
</tr>
<tr style="background-color: white">
<td>Current Contract Vehicle</td>
<td><%= f.text_field :curent_contract_vehicle %></td>
</tr>
<tr style="background-color: white">
<td>New Contract Vehicle</td>
<td><%= f.text_field :new_contract_vehicle %></td>
</tr>
<tr style="background-color: white">
<td>Small Business Set Aside?</td>
<td><%= f.select :sb_set_aside, [[],['Yes', 'Yes'], ['No', 'No']] %></td>
</tr>
<tr style="background-color: white">
<td>Prime or Sub</td>
<td><%= f.select :prime_or_sub, [[],['Prime', 'Prime'], ['Sub', 'Sub']] %></td>
</tr>
<tr style="background-color: white">
<td>NAICS</td>
<td><%= f.text_field :naics %></td>
</tr>
<tr style="background-color: white">
<td>RFI Date</td>
<td><%= f.date_select :rfi_date, {:include_blank => true, :default => nil} %></td>
</tr>
<tr style="background-color: white">
<td>RFI Submitted?</td>
<td><%= f.select :rfi_submitted, [[],['Yes', 'Yes'], ['No', 'No']] %></td>
</tr>
<tr style="background-color: white">
<td>Est. RFP Date</td>
<td><%= f.date_select :est_rfp_date, {:include_blank => true, :default => nil} %></td>
</tr>
<tr style="background-color: white">
<td>Est. Full Value</td>
<td><%= f.text_field :est_full_value%></td>
</tr>
<tr style="background-color: white">
<td>Est. Workshare (%)</td>
<td><%= f.text_field :est_workshare %></td>
</tr>
</table>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
My routes file:
Rails.application.routes.draw do
resources :test_users
get 'profile/my_profile'
get "log_out" => "sessions#destroy", :as => "log_out"
get "log_in" => "sessions#new", :as => "log_in"
get "sign_up" => "users#new", :as => "sign_up"
root :to => "sessions#new"
get 'view_submitted/submitted'
get 'view_action_list/seven'
get 'show_number/thirty'
get 'show_number/sixty'
get 'show_number/year'
get 'view_retired/retired'
resources :users
resource :sessions
get 'report/report_page'
resources :opportunities do
resources :activities
resources :updates
resources :contacts
resources :links
end
First, your submit button is in your view, please post that. :)
Second, you're doing an HTTP GET with the parameters that would typically be in a POST. Have you specified your method: :get in the form for some reason accidentally?

Resources