Last active
December 16, 2015 10:39
-
-
Save richardsondx/5421335 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::RoutingError at /projects/com.test.tester/edit | |
No route matches {:controller=>"projects", :action=>"show", :format=>nil, :project_name=>#<Project id: 1, min_android_phone_app_version: 1, min_android_tablet_app_version: 1, min_android_iphone_app_version: 1, min_android_ipad_app_version: 1, min_app_version: 1, created_at: "2013-04-18 22:13:28", updated_at: "2013-04-18 22:13:28", project_name: "com.test.tester", creative_url: "">} | |
#<Class:0x007fbafdb101b0>#_app_views_projects__form_html_erb__3657852997696426320_70220593400580 | |
app/views/projects/_form.html.erb, line 1 | |
1 <%= form_for(@project) do |f| %> | |
2 <% if @project.errors.any? %> | |
3 <div id="error_explanation"> | |
4 <h2><%= pluralize(@project.errors.count, "error") %> prohibited this project from being saved:</h2> | |
5 | |
6 <ul> | |
#<Class:0x007fbafdb101b0>#_app_views_projects_edit_html_erb___32833286902762729_70220595490880 | |
app/views/projects/edit.html.erb, line 3 | |
1 <h1>Editing project</h1> | |
2 | |
3 <%= render 'form' %> | |
4 | |
5 <%= link_to 'Show', @project %> | | |
6 <%= link_to 'Back', projects_path %> | |
Request info | |
Request parameters | |
{"controller"=>"projects", "action"=>"edit", "project_name"=>"com.test.tester"} | |
Local Variables | |
local_assigns | |
{} | |
output_buffer | |
nil | |
_old_virtual_path | |
nil | |
_old_output_buffer | |
nil | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def edit | |
@projects = Project.all | |
@project = Project.find_by_project_name(params[:project_name]) | |
end | |
def show | |
@projects = Project.all | |
@project = Project.find_by_project_name(params[:project_name]) | |
respond_to do |format| | |
format.html # show.html.erb | |
format.json { render json: @project, root: false } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project < ActiveRecord::Base | |
# ... | |
def to_params | |
"#{project_name}" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get "/projects" => "projects#index", as: "projects" | |
get "/projects/new" => "projects#new", as: "new_project" | |
post "/projects" => "projects#create" | |
get "/projects/:project_name" => "projects#show", as: "project", :constraints => { :project_name => /com\.\w+\.\w+/ } | |
get "/projects/:project_name/edit" => "projects#edit", as: "edit_project", :constraints => { :project_name => /com\.\w+\.\w+/ } | |
put "/projects/:project_name" => "projects#update", :constraints => { :project_name => /com\.\w+\.\w+/ } | |
delete "/projects/:project_name" => "projects#destroy", :constraints => { :project_name => /com\.\w+\.\w+/ } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://localhost:3000/projects/com.test.tester/edit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment