Ruby on Rails
Sunday, September 28, 2014
It works fine. I have problem on the ActiveAdmin gem form(formtastic-based for form construction.
In the ActiveAdmin/Order I have
form do |f|
f.inputs do
f.input :title
f.has_many :line_items, :allow_destroy => true do |lp|
lp.input :language_pair
end
end
f.actions
end
I would like to pass two variable :source and :target just as the normal form, but it seems I cannot do it with ActiveAdmin. I think I will go with a custom form.
On Monday, 29 September 2014 11:44:04 UTC+9, Vivek Sampara wrote:
-- In the ActiveAdmin/Order I have
form do |f|
f.inputs do
f.input :title
f.has_many :line_items, :allow_destroy => true do |lp|
lp.input :language_pair
end
end
f.actions
end
I would like to pass two variable :source and :target just as the normal form, but it seems I cannot do it with ActiveAdmin. I think I will go with a custom form.
On Monday, 29 September 2014 11:44:04 UTC+9, Vivek Sampara wrote:
Do you have any issues with the form currently ?On Mon, Sep 29, 2014 at 7:35 AM, Paolo Wang <paulw...@gmail.com> wrote:Thank you very much.--
Using 'Language.all.permutation(2).to_a' I've got all the combinations (A->B and B->A) and seeded the LanguagePair model. For the cost I was thinking to puts a decimal column in the LanguagePair model.
At the moment I am working on the form(inside the lineitem views):
<div class="field">
<%= label_tag :from, "Source Language" %><br />
<%= select_tag :from, options_for_select(@from_lang), {id: 'source_select'} %> I haven't got a lots of experience with Rails and I am always searching for a better ways to write things.
</div>
<div class="field">
<%= label_tag :to, "Target Language" %><br />
<%= select_tag :to, options_for_select(@to_lang), {id: 'target_select'} %>
</div>
and LineItem controller:
def new
@line_item = LineItem.new
@from_lang = Product.uniq.pluck(:from)
@to_lang = Product.where(from: @from_lang.first).pluck(:to)
end
Regards
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com .
To post to this group, send email to rubyonra...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ .f1bcc415-a3b3-4b41-b860- 71497f6779d2%40googlegroups. com
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1567621c-a96b-45cb-84c8-52594e468a11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment