text_field value is not read in controller when using create form in the index viewlink_to :action => 'create' going to index rather than 'create'Difficulty in getting mp3 to work in PaperclipRails: loop through array to create outputGet the name of a parent resource when working with a nested resourceRails 4 Form Data Is Saving as Nilupgrade to rails 4, can no longer register usersRails pass generated js params from form to controllerNoMethodError in Rooms#indexundefined method `url' for #<ActiveRecord::Associations::CollectionProxy []>Group chat app with ActionCable gives error ActionController::InvalidAuthenticityToken
Cuban Primes
Could a space colony 1g from the sun work?
Is there an academic word that means "to split hairs over"?
Pedaling at different gear ratios on flat terrain: what's the point?
Why is the marginal distribution/marginal probability described as "marginal"?
Capital gains on stocks sold to take initial investment off the table
Do high-wing aircraft represent more difficult engineering challenges than low-wing aircraft?
What formula to chose a nonlinear formula?
How does the Heat Metal spell interact with a follow-up Frostbite spell?
bash: Counting characters within multiple files
Square spiral in Mathematica
Given 0s on Assignments with suspected and dismissed cheating?
What are the effects of eating many berries from the Goodberry spell per day?
What kind of environment would favor hermaphroditism in a sentient species over regular, old sexes?
Why aren't satellites disintegrated even though they orbit earth within their Roche Limits?
Why does the U.S military use mercenaries?
Write electromagnetic field tensor in terms of four-vector potential
Divisor Rich and Poor Numbers
What is this rubber on gear cables
Is Precocious Apprentice enough for Mystic Theurge?
Can a person still be an Orthodox Jew and believe that the Torah contains narratives that are not scientifically correct?
Why use a retrograde orbit?
What would a Dragon have to exhale to cause rain?
Why would you put your input amplifier in front of your filtering for and ECG signal?
text_field value is not read in controller when using create form in the index view
link_to :action => 'create' going to index rather than 'create'Difficulty in getting mp3 to work in PaperclipRails: loop through array to create outputGet the name of a parent resource when working with a nested resourceRails 4 Form Data Is Saving as Nilupgrade to rails 4, can no longer register usersRails pass generated js params from form to controllerNoMethodError in Rooms#indexundefined method `url' for #<ActiveRecord::Associations::CollectionProxy []>Group chat app with ActionCable gives error ActionController::InvalidAuthenticityToken
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
The problem is that, I want to create a Group
and I'm using the form in index.html.erb
to use the create
action in groups controller but the parameter :name
is not passed to the controller.
the form is:
<%= form_for @group ,url: controller: "groups", action: "create" do |f| %>
<%= f.label :name %>
<%= f.text_field :name, id: 'grpName', class: 'form-control'%>
<%= f.submit "Add Group" , class:"btn btn-light" , onclick: "addGroup();" %>
< %end %>
the controller is:
def index
@groups = Group.all
@group = Group.new
end
def create
@user_id=1
@group = Group.new(group_params)
@group.user_id = @user_id
@group.save
end
private
def group_params
params.require(:group).permit(:name)
end
def group_params
params.require(:group).permit(:name)
end
ruby-on-rails
add a comment |
The problem is that, I want to create a Group
and I'm using the form in index.html.erb
to use the create
action in groups controller but the parameter :name
is not passed to the controller.
the form is:
<%= form_for @group ,url: controller: "groups", action: "create" do |f| %>
<%= f.label :name %>
<%= f.text_field :name, id: 'grpName', class: 'form-control'%>
<%= f.submit "Add Group" , class:"btn btn-light" , onclick: "addGroup();" %>
< %end %>
the controller is:
def index
@groups = Group.all
@group = Group.new
end
def create
@user_id=1
@group = Group.new(group_params)
@group.user_id = @user_id
@group.save
end
private
def group_params
params.require(:group).permit(:name)
end
def group_params
params.require(:group).permit(:name)
end
ruby-on-rails
please, fix your code formatting
– buncis
Mar 23 at 16:19
add a comment |
The problem is that, I want to create a Group
and I'm using the form in index.html.erb
to use the create
action in groups controller but the parameter :name
is not passed to the controller.
the form is:
<%= form_for @group ,url: controller: "groups", action: "create" do |f| %>
<%= f.label :name %>
<%= f.text_field :name, id: 'grpName', class: 'form-control'%>
<%= f.submit "Add Group" , class:"btn btn-light" , onclick: "addGroup();" %>
< %end %>
the controller is:
def index
@groups = Group.all
@group = Group.new
end
def create
@user_id=1
@group = Group.new(group_params)
@group.user_id = @user_id
@group.save
end
private
def group_params
params.require(:group).permit(:name)
end
def group_params
params.require(:group).permit(:name)
end
ruby-on-rails
The problem is that, I want to create a Group
and I'm using the form in index.html.erb
to use the create
action in groups controller but the parameter :name
is not passed to the controller.
the form is:
<%= form_for @group ,url: controller: "groups", action: "create" do |f| %>
<%= f.label :name %>
<%= f.text_field :name, id: 'grpName', class: 'form-control'%>
<%= f.submit "Add Group" , class:"btn btn-light" , onclick: "addGroup();" %>
< %end %>
the controller is:
def index
@groups = Group.all
@group = Group.new
end
def create
@user_id=1
@group = Group.new(group_params)
@group.user_id = @user_id
@group.save
end
private
def group_params
params.require(:group).permit(:name)
end
def group_params
params.require(:group).permit(:name)
end
ruby-on-rails
ruby-on-rails
edited Mar 23 at 16:40
Sajad Rastegar
85721426
85721426
asked Mar 23 at 16:12
Motaz Abo ElnasrMotaz Abo Elnasr
61
61
please, fix your code formatting
– buncis
Mar 23 at 16:19
add a comment |
please, fix your code formatting
– buncis
Mar 23 at 16:19
please, fix your code formatting
– buncis
Mar 23 at 16:19
please, fix your code formatting
– buncis
Mar 23 at 16:19
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315746%2ftext-field-value-is-not-read-in-controller-when-using-create-form-in-the-index-v%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315746%2ftext-field-value-is-not-read-in-controller-when-using-create-form-in-the-index-v%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
please, fix your code formatting
– buncis
Mar 23 at 16:19