bala2
(bala)
1
Hi
Im using the 5 views and one controller.To edit the form and
produced Couldn’t find ResortBasic without an ID
View code
…editresortbasic.html.erb
<% form_tag :action => ‘editresortbasic’,:controller=>‘Wizard’ do %>
Edit Resort Basic
Resort Name
|
<%= text_field_tag :resortname %>
</td>
</tr>
<tr>
<td>
<b>Resort Type</b>
</td>
<td>
<!--%=f.collection_select(resort_basic.resorttypeid, ResortType.find(:all),id,resorttype)%-->
<%=select("resorttype", "resorttypeid", ResortType.find(:all).collect {|p| [ p.resorttype, [p.id](http://p.id) ] })%>
</td>
</tr>
<tr>
<td>
<b>Resort Class</b>
</td>
<td>
<!--%=collection_select(:resortclassid, ResortClass.find(:all),:id,:resortclass)%-->
<%=select("resortclass", "resortclassid", ResortClass.find(:all).collect {|p| [ p.resortclass, [p.id](http://p.id) ] })%>
|
Season
|
<%=select("seasontype", "seasontypeid", Season.find(:all).collect {|p| [ p.seasontype, [p.id](http://p.id) ] })%>
|
Website
|
<%= text_field_tag :website %>
|
<td>
<%= submit_tag "Next",:class =>'myButton' %>
</td>
</tr>
<% end %>
controller code…
def editresortbasic
@resort_basic = ResortBasic.find(params[:id])
if request.post?
@resort_basic.update_attributes(params[:resort_basic])
# flash[:notice] = ‘City was successfully updated.’
# render :action=>'editresortcontact'
end
but i got the bugs
MaD
(MaD)
2
i think your params[:id] does not get set in your view. so whenever
you hit the submit-button, you get that error.
maybe i'm missing something, but a debugger at the beginning of your
method-body in your controller should help clearify that issue.
MaD
bala2
(bala)
3
Hi
im using edit form and i got error
ActiveRecord::RecordNotFound in WizardController#editresortbasic
Couldn't find ResortBasic without an ID
controller code
Error in line:
@resort_basic =ResortBasic.find(params[:id]) if anybody know give idea
debugger the code using in view page
<%= debug(params)%>
and i got the error :
— !map:HashWithIndifferentAccess
controller: wizard
action: editresortbasic
Thanks
11175
(-- --)
4
You obviously don't have the :id available...
Why don't you just run your app, go to edit a resort, and view the page
source generated for that first page (step 1 in your wizard?).
What does the form element on the rendered page look like? Does it
mention the current resort_basic id?
bala2
(bala)
5
Hi
Im using the 5 views and one controller.To edit the form and
produced Couldn’t find ResortBasic without an ID
View code
…editresortbasic.html.erb
<% form_tag :action => ‘editresortbasic’,:controller=>‘Wizard’ do %>
Edit Resort Basic
Resort Name
|
<%= text_field_tag :resortname %>
</td>
</tr>
<tr>
<td>
<b>Resort Type</b>
</td>
<td>
<!--%=f.collection_select(resort_basic.resorttypeid, ResortType.find(:all),id,resorttype)%-->
<%=select("resorttype", "resorttypeid", ResortType.find(:all).collect {|p| [ p.resorttype, [p.id](http://p.id/) ] })%>
</td>
</tr>
<tr>
<td>
<b>Resort Class</b>
</td>
<td>
<!--%=collection_select(:resortclassid, ResortClass.find(:all),:id,:resortclass)%-->
<%=select("resortclass", "resortclassid", ResortClass.find(:all).collect {|p| [ p.resortclass, [p.id](http://p.id/) ] })%>
|
Season
|
<%=select("seasontype", "seasontypeid", Season.find(:all).collect {|p| [ p.seasontype, [p.id](http://p.id/) ] })%>
|
Website
|
<%= text_field_tag :website %>
|
<td>
<%= submit_tag "Next",:class =>'myButton' %>
</td>
</tr>
<% end %>
controller code…