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;








0















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









share|improve this question
























  • please, fix your code formatting

    – buncis
    Mar 23 at 16:19


















0















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









share|improve this question
























  • please, fix your code formatting

    – buncis
    Mar 23 at 16:19














0












0








0








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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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













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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현